
Product
Socket MCP Adds Org Alerts, Threat Feed Review, and Package Inspection
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.
@tokenlens/fetch
Advanced tools
Typed client for models.dev to fetch model catalogs with friendly errors.

Tiny typed client for https://models.dev/api.json with friendly error codes.
Install
npm i @tokenlens/fetchpnpm add @tokenlens/fetchyarn add @tokenlens/fetchAPI
fetchModels({ provider?, model?, fetch?, signal?, baseUrl? })getModelMeta(providers, ...)Usage
import { fetchModels, getModelMeta, FetchModelsError } from '@tokenlens/fetch';
const catalog = await fetchModels();
const openai = await fetchModels({ provider: 'openai' });
const gpt4o = await fetchModels({ provider: 'openai', model: 'gpt-4o' });
// Pick raw metadata directly from the fetched catalog
const prov = getModelMeta({ providers: catalog, provider: 'openai' });
const model = getModelMeta({ providers: catalog, id: 'openai:gpt-4o' });
try {
await fetchModels();
} catch (err) {
if (err instanceof FetchModelsError) {
// 'UNAVAILABLE' | 'NETWORK' | 'HTTP' | 'PARSE'
console.error(err.code, err.status, err.message);
}
}
License MIT
FAQs
Typed client for models.dev to fetch model catalogs with friendly errors.
The npm package @tokenlens/fetch receives a total of 413,875 weekly downloads. As such, @tokenlens/fetch popularity was classified as popular.
We found that @tokenlens/fetch demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.

Research
More than 140 Mastra npm packages were compromised in a supply chain attack that used a typosquatted dependency to deliver a cross-platform infostealer during installation.