Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@maiife-ai-pub/cost

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@maiife-ai-pub/cost

AI spend calculator + optimizer — unified cost report across vendors

latest
Source
npmnpm
Version
0.2.2
Version published
Maintainers
1
Created
Source

@maiife-ai-pub/cost

AI spend calculator + optimizer — unified cost report across OpenAI, Anthropic, Cohere, Google, and local models.

npm License

Part of the Maiife AI Governance Toolkit.

Install

npm install -g @maiife-ai-pub/cost
# or run without installing
npx @maiife-ai-pub/cost report

CLI

# Spend report for the last 30 days
maiife-cost report

# Optimization suggestions
maiife-cost optimize

Set your API keys as environment variables:

export OPENAI_API_KEY=sk-...
export ANTHROPIC_API_KEY=sk-ant-...

MCP Server

{
  "mcpServers": {
    "maiife-cost": {
      "command": "npx",
      "args": ["@maiife-ai-pub/cost", "mcp"]
    }
  }
}

Available tools: cost_report, cost_optimize

Programmatic API

import { estimateCost } from "@maiife-ai-pub/cost";

// Estimate cost for a single request
const usd = estimateCost("gpt-4o", 1500, 300);
console.log(`$${usd.toFixed(4)}`);

Supported Models & Pricing

Includes current pricing for: gpt-4.1, gpt-4.1-mini, gpt-4o, o3, o3-mini, o4-mini, claude-opus-4-5, claude-sonnet-4-5, claude-haiku-4-5, gemini-2.5-pro, gemini-2.5-flash, command-r-plus, and more.

Pricing updated April 2026.

License

Apache 2.0 — Built by Maiife

Keywords

maiife

FAQs

Package last updated on 13 Apr 2026

Did you know?

Socket

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.

Install

Related posts