Interface AnthropicModelPrice

A Claude model's list prices in USD per 1K tokens, the shape a host's spend guard reads for OpenAI from openAIModelPricing: input for prompt tokens, output for completion tokens, cacheRead for prompt-cache hits, and longContext on a model Anthropic prices by prompt length, with the prompt size above which its input and output rates apply.

interface AnthropicModelPrice {
    input: number;
    output: number;
    cacheRead: number;
    longContext?: {
        fromTokens: number;
        input: number;
        output: number;
        cacheRead: number;
    };
}

Properties

input: number
output: number
cacheRead: number
longContext?: {
    fromTokens: number;
    input: number;
    output: number;
    cacheRead: number;
}

Type declaration

  • Readonly fromTokens: number
  • Readonly input: number
  • Readonly output: number
  • Readonly cacheRead: number

    The cache-read rate over fromTokens: the base rate scaled as the input rate is.