Skip to content

Commit 7c34492

Browse files
tombeckenhamclaude
andcommitted
ci: run the Anthropic Models API sync in the nightly model-metadata workflow
pnpm generate:models now chains the Anthropic fetch + sync after the OpenRouter sync, so the nightly sync-models workflow keeps @tanstack/ai-anthropic current too. The workflow passes ANTHROPIC_API_KEY (new repo secret required) to the sync step and commits the refreshed scripts/anthropic.models.json snapshot alongside package changes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent b105240 commit 7c34492

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

.github/workflows/sync-models.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ jobs:
2929

3030
- name: Fetch and sync model metadata
3131
run: pnpm generate:models
32+
env:
33+
# Required by generate:anthropic-models:fetch — Anthropic models are
34+
# synced from the first-party Models API, not OpenRouter.
35+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
3236

3337
- name: Check for package changes
3438
id: changes
@@ -44,8 +48,8 @@ jobs:
4448
run: |
4549
git config user.name "github-actions[bot]"
4650
git config user.email "github-actions[bot]@users.noreply.github.com"
47-
git add packages/ scripts/openrouter.models.json scripts/.sync-models-last-run .changeset/
48-
git commit -m "chore: sync model metadata from OpenRouter"
51+
git add packages/ scripts/openrouter.models.json scripts/anthropic.models.json scripts/.sync-models-last-run .changeset/
52+
git commit -m "chore: sync model metadata from provider APIs"
4953
git push --force origin HEAD:automated/sync-models
5054
env:
5155
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -61,16 +65,19 @@ jobs:
6165
6266
if [ -z "$EXISTING_PR" ] || [ "$EXISTING_PR" = "null" ]; then
6367
BODY=$(cat <<'PRBODY'
64-
Automated daily sync of model metadata from the OpenRouter API.
68+
Automated daily sync of model metadata from provider APIs.
6569
6670
- Fetches the latest model list from OpenRouter
6771
- Converts to the internal adapter format
6872
- Syncs provider-specific model metadata for affected packages
73+
- Fetches the Anthropic catalog from the first-party Models API and
74+
adds any new models to `@tanstack/ai-anthropic` (new models fail
75+
the job until a pricing row is added to `sync-anthropic-models.ts`)
6976
- Creates a patch changeset for all changed packages
7077
PRBODY
7178
)
7279
gh pr create \
73-
--title "chore: sync model metadata from OpenRouter" \
80+
--title "chore: sync model metadata from provider APIs" \
7481
--body "$BODY" \
7582
--base main \
7683
--head "$BRANCH"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"dev:chat": "pnpm --filter ts-react-chat dev",
3838
"format": "prettier --experimental-cli --ignore-unknown '**/*' --write",
3939
"generate-docs": "node scripts/generate-docs.ts && pnpm run copy:readme",
40-
"generate:models": "pnpm generate:models:fetch && pnpm regenerate:models && tsx scripts/sync-provider-models.ts && pnpm format",
40+
"generate:models": "pnpm generate:models:fetch && pnpm regenerate:models && tsx scripts/sync-provider-models.ts && pnpm generate:anthropic-models:fetch && pnpm regenerate:anthropic-models && pnpm format",
4141
"generate:models:fetch": "tsx scripts/fetch-openrouter-models.ts",
4242
"regenerate:models": "tsx scripts/convert-openrouter-models.ts",
4343
"generate:anthropic-models": "pnpm generate:anthropic-models:fetch && pnpm regenerate:anthropic-models && pnpm format",

0 commit comments

Comments
 (0)