cloudflare-docs/bin/fetch-ai-models.js
Kody Jackson e235a6dcd9
Some checks are pending
Publish / Production (push) Waiting to run
[Workers AI] Update endpoint (#26411)
2025-11-10 09:52:46 -06:00

14 lines
345 B
JavaScript

import fs from "fs";
fetch("https://ai-cloudflare-com.pages.dev/api/models")
.then((res) => res.json())
.then((data) => {
data.models.map((model) => {
const fileName = model.name.split("/")[2];
fs.writeFileSync(
`./src/content/workers-ai-models/${fileName}.json`,
JSON.stringify(model, null, 4),
"utf-8",
);
});
});