npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ank1015/agents-provider-anthropic-spec

v0.1.11

Published

Anthropic provider static spec (model catalog, config + per-call option types) for @ank1015/agents.

Readme

@ank1015/agents-provider-anthropic-spec

Static Anthropic provider metadata for the @ank1015/agents packages.

This package contains no live Anthropic client. It provides provider identity, config types, provider-specific type augmentation, and a static model catalog that other packages can consume without depending on the Anthropic runtime adapter.

Install

pnpm add @ank1015/agents-provider-anthropic-spec

What This Package Provides

  • ANTHROPIC_PROVIDER provider id.
  • anthropicProviderConfigSchema for provider config validation.
  • AnthropicProviderOptions based on Anthropic Messages API request options.
  • AnthropicNativeMessage based on Anthropic SDK message responses.
  • ANTHROPIC_MODELS static model catalog.
  • AnthropicModelId literal union derived from the catalog.
  • Contract augmentation for @ank1015/agents-contracts.

Import Paths

import {
  ANTHROPIC_MODELS,
  ANTHROPIC_PROVIDER,
  getAnthropicModel,
} from '@ank1015/agents-provider-anthropic-spec';

import { anthropicProviderConfigSchema } from '@ank1015/agents-provider-anthropic-spec/config';
import type { AnthropicModelId } from '@ank1015/agents-provider-anthropic-spec/models';

Provider Config

Anthropic provider config uses a secret reference for the API key. Environment references keep keys out of config:

import {
  ANTHROPIC_PROVIDER,
  anthropicProviderConfigSchema,
} from '@ank1015/agents-provider-anthropic-spec';

const config = anthropicProviderConfigSchema.parse({
  provider: ANTHROPIC_PROVIDER,
  apiKey: {
    type: 'env',
    name: 'ANTHROPIC_API_KEY',
  },
});

The live adapter resolves the referenced environment variable when it creates the Anthropic SDK client. Callers that already have a key from another secret source can pass a direct value reference:

const config = anthropicProviderConfigSchema.parse({
  provider: ANTHROPIC_PROVIDER,
  apiKey: {
    type: 'value',
    value: anthropicKey,
  },
});

Model Catalog

ANTHROPIC_MODELS is a static snapshot used for model lookup, UI metadata, defaults, and compile-time model-id narrowing:

import {
  ANTHROPIC_MODELS,
  getAnthropicModel,
} from '@ank1015/agents-provider-anthropic-spec';

const model = getAnthropicModel('claude-sonnet-4-6');

The catalog currently includes:

  • claude-opus-4-8
  • claude-sonnet-4-6
  • claude-sonnet-5
  • claude-fable-5
  • claude-haiku-4-5

Static model metadata can age as providers release or retire models. Treat pricing, context windows, and max-token metadata as package-versioned snapshot data.

Type Augmentation

Importing this package augments @ank1015/agents-contracts so Anthropic requests can narrow provider-specific fields:

import type { LLMRequest } from '@ank1015/agents-contracts';
import type { AnthropicProvider } from '@ank1015/agents-provider-anthropic-spec';

const request: LLMRequest<AnthropicProvider> = {
  provider: 'anthropic',
  modelId: 'claude-sonnet-4-6',
  messages: [],
};

Versioning

This package is currently 0.1.11. Until 1.0.0, model metadata and provider option types may evolve as the surrounding agent runtime settles.