Endpoints

GET /api/v1/models.json

All models with full pricing detail, capabilities, and metadata.

GET /api/v1/models.min.json

Minimal model data for lightweight consumers (id, name, provider, pricing, context window).

GET /api/v1/providers/[provider].json

Models filtered by provider (e.g., /api/v1/providers/anthropic.json).

GET /api/v1/tools.json

IDE tool pricing (Cursor, Windsurf, Claude Code, GitHub Copilot, OpenAI Codex).

GET /api/v1/changelog.json

Recent price changes and updates.

Usage

All endpoints return JSON with CORS enabled. No authentication required.

Example: Fetch all models

const response = await fetch('https://tokrates.com/api/v1/models.json');
const feed = await response.json();

console.log(feed.metadata.modelCount); // Number of models
console.log(feed.models[0].pricing);   // Pricing for first model

Example: Get cheapest model

const feed = await fetch('https://tokrates.com/api/v1/models.min.json')
  .then(r => r.json());

const cheapest = feed.models
  .filter(m => m.tier !== 'economy')
  .sort((a, b) => a.inputPerMTok - b.inputPerMTok)[0];

console.log(`${cheapest.name}: $${cheapest.inputPerMTok}/1M input tokens`);

Example: Monthly cost estimate

function estimateMonthlyCost(model, inputTokens, outputTokens) {
  const inputCost = (inputTokens / 1_000_000) * model.pricing.inputPerMTok;
  const outputCost = (outputTokens / 1_000_000) * model.pricing.outputPerMTok;
  return inputCost + outputCost;
}

Data Freshness

Pricing data is scraped daily from official provider pages. The metadata.generatedAt field in each feed shows the last update time. Individual models have a lastVerified field.