AI Pricing Hub Source SDKs

Source SDKs

AI Pricing Hub SDKs

Use the checked-in JavaScript, TypeScript, and Python clients for the AI Pricing Hub REST API and MCP server. The SDKs are read-only, typed, retry-capable, and configurable for future authentication.

Installation

Install from source packages

The SDK source packages are included in the AI Pricing Hub repository under /sdk/javascript and /sdk/python. They are not currently published to npm or PyPI, so install from the checked-out source path or use the public REST API directly.

JavaScript / TypeScript
npm install ./sdk/javascript

Run from the repository root after cloning. ESM, CommonJS, and TypeScript declarations are included.

Python
python -m pip install ./sdk/python

Run from the repository root after cloning. Type hints and py.typed are included.

Quick Start

Create a client

JavaScript
import { AIPricingHubClient } from "@aipricinghub/sdk";

const client = new AIPricingHubClient();
const models = await client.searchModels({ query: "gpt", provider: "openai" });
Python
from aipricinghub import AIPricingHubClient

client = AIPricingHubClient()
models = client.search_models(query="gpt", provider="openai")

Authentication

Future-ready configuration

The public API and MCP server do not require authentication today. Both SDKs expose base URL, timeout, retry, and transport configuration so API keys or authenticated hosts can be added later without changing method names.

Examples

Common workflows

Search models

Search models

JavaScript / TypeScript

await client.searchModels({ query: "gpt", provider: "openai" });

Python

client.search_models(query="gpt", provider="openai")
Find cheapest

Find cheapest

JavaScript / TypeScript

await client.findCheapest({ provider: "openai", limit: 5 });

Python

client.find_cheapest(provider="openai", limit=5)
Compare models

Compare models

JavaScript / TypeScript

await client.compareModels(["openai-gpt-5", "anthropic-claude-4-sonnet-20250514"]);

Python

client.compare_models(["openai-gpt-5", "anthropic-claude-4-sonnet-20250514"])
Calculate cost

Calculate cost

JavaScript / TypeScript

const model = await client.getModel("openai-gpt-5");
client.calculateCost(model, { inputTokens: 1000, outputTokens: 500, requests: 10000 });

Python

model = client.get_model("openai-gpt-5")
client.calculate_cost(model, input_tokens=1000, output_tokens=500, requests=10000)
Provider summary

Provider summary

JavaScript / TypeScript

await client.providerSummary("openai");

Python

client.provider_summary("openai")
Latest changes

Latest changes

JavaScript / TypeScript

await client.latestChanges({ provider: "openai", limit: 10 });

Python

client.latest_changes(provider="openai", limit=10)
Benchmarks

Benchmarks

JavaScript / TypeScript

await client.benchmarkLookup({ benchmarkId: "mmlu" });

Python

client.benchmark_lookup(benchmark_id="mmlu")
MCP tools

MCP tools

JavaScript / TypeScript

await client.callMcpTool("find_cheapest", { provider: "openai", limit: 5 });

Python

client.call_mcp_tool("find_cheapest", {"provider": "openai", "limit": 5})

Coverage

Methods included

AreaMethods
API endpointslistProviders, getProvider, listModels, getModel, listRankings, getRanking, getHistory, getMarket, getChangelog
HelperssearchModels, findCheapest, compareModels, calculateCost, providerSummary, latestChanges, benchmarkLookup, pagination helpers
MCPmcpRequest, listMcpTools, callMcpTool, listMcpResources, readMcpResource, listMcpPrompts, getMcpPrompt

Public API

Build with AI Pricing Hub data

Use static JSON endpoints for providers, models, rankings, history, market metrics, and changelog events.

Newsletter

Get AI pricing changes in your inbox

Monthly pricing moves, new model launches, and practical cost notes. Provider integration is not enabled yet.

Editorial information

Reviewed by AI Pricing Hub Editorial

Last updated

2026-08-04

Methodology

Methodology explains collection, validation, limitations, and update cadence.