Developer Guide

How to Use a Free LLM Pricing API in Your Projects

Fetch real-time pricing for 39 AI models from 10 providers. Build cost dashboards, CI/CD budget checks, and internal tools — no API key needed.

If you're building with AI APIs, you need to track pricing. Models get repriced constantly (DeepSeek dropped 90% in 6 months), new models launch weekly, and deprecated models stop working without warning.

Instead of manually checking 10 provider pricing pages, you can pull structured data from a single API endpoint. Here's how.

The API: 6 Endpoints, Zero Auth

The APIpulse LLM Pricing API is free, CORS-enabled, and requires no API key. It covers 39 models across 10 providers with verified pricing data updated regularly.

GET /api/pricing

Returns all 39 models with pricing, context windows, tier, and provider info. Supports filtering by provider, tier, or individual model.

Try it live →
GET /api/calculate

Calculate monthly cost for a specific model based on your usage (tokens per request, requests per day).

Try it live →
GET /api/cheapest

Find the cheapest model for your workload. Returns top 5 cheapest options ranked by total monthly cost.

Try it live →
GET /api/compare

Compare multiple models side by side. Pass comma-separated model IDs for a detailed cost breakdown.

Try it live →
GET /api/badge

Get an SVG pricing badge for any model. Embed in READMEs, docs, or dashboards. Auto-updates when prices change.

Try it live →
GET /api/recommend

Get model recommendations based on use case and budget. Returns ranked suggestions with cost estimates.

Try it live →

Quick Start: Fetch Pricing in JavaScript

Here's the simplest possible integration — fetch all models and display the cheapest option:

// Fetch all LLM pricing data
const res = await fetch('https://getapipulse.com/api/pricing');
const { models, meta } = await res.json();

console.log(`Tracking ${meta.count} models across ${meta.providers.length} providers`);
// → Tracking 39 models across 10 providers

// Find cheapest model
const sorted = models
  .filter(m => !m.deprecated)
  .sort((a, b) => a.input - b.input);

console.log(`Cheapest: ${sorted[0].name} at $${sorted[0].input}/M input`);
// → Cheapest: Gemini 2.0 Flash Lite at $0.075/M input

Quick Start: Python

import requests

# Fetch pricing for a specific provider
res = requests.get('https://getapipulse.com/api/pricing', params={'provider': 'openai'})
data = res.json()

for model in data['models']:
    print(f"{model['name']}: ${model['input']}/M in, ${model['output']}/M out")

# Output:
# GPT-5.5: $5.0/M in, $30.0/M out
# GPT-5: $1.25/M in, $10.0/M out
# GPT-5 mini: $0.25/M in, $2.0/M out
# ...

Quick Start: cURL

# Get cheapest model for 1000 requests/day
curl "https://getapipulse.com/api/cheapest?input_tokens=1000&output_tokens=500&requests=1000"

# Compare GPT-5 vs Claude Sonnet 4.6
curl "https://getapipulse.com/api/compare?models=openai-gpt5,anthropic-sonnet46"

# Get a pricing badge (SVG)
curl "https://getapipulse.com/api/badge?model=openai-gpt5"

5 Things You Can Build

Cost Dashboard

Display live pricing for your team's models. Auto-updates when providers change prices.

CI/CD Budget Check

Add a pre-deploy check that flags if your model choice exceeds budget thresholds.

README Badges

Embed pricing badges in your repo. Shows current cost per 1M tokens — auto-updates.

Cost Alert System

Poll the API daily, compare to yesterday's prices, alert your team when costs change.

Model Advisor

Given a use case and budget, recommend the best model. Use /api/recommend endpoint.

Example: CI/CD Budget Gate

Add this to your GitHub Actions to block deploys that use models exceeding your budget:

# .github/workflows/cost-check.yml
name: AI Cost Check
on: [pull_request]

jobs:
  check-cost:
    runs-on: ubuntu-latest
    steps:
      - name: Check model pricing
        run: |
          MODEL="openai-gpt5"
          BUDGET=500  # $500/month max

          COST=$(curl -s "https://getapipulse.com/api/calculate?model=$MODEL&requests=10000" | jq '.totalMonthlyCost')

          if (( $(echo "$COST > $BUDGET" | bc -l) )); then
            echo "⚠️ $MODEL costs \$$COST/month — exceeds \$$BUDGET budget!"
            exit 1
          fi
          echo "✅ $MODEL costs \$$COST/month — within budget"

Embeddable Pricing Badges

Add a live pricing badge to your README with one line of markdown:

![GPT-5 Pricing](https://getapipulse.com/api/badge?model=openai-gpt5)

This renders an SVG badge showing the model name and current input/output pricing per 1M tokens. It auto-updates when prices change. Works in GitHub READMEs, documentation sites, and Notion pages.

Full API documentation with all endpoints, parameters, and response schemas:

View API Docs →

Data Freshness

Pricing data is verified against provider pricing pages regularly. The API response includes a lastUpdated field so you can check freshness programmatically. When providers announce price changes, the data is updated within 24-48 hours.

Models that are deprecated (like Claude 4 Opus, retiring June 15, 2026) include a deprecated flag with the deprecation date and replacement model ID, so your tools can handle migrations automatically.

No API Key, No Rate Limits

The API is free to use with no authentication required. It's served from Vercel's edge network with 1-hour caching, so it's fast and reliable. If you're making more than ~1000 requests/minute, consider caching responses locally.

A credit or link to getapipulse.com is appreciated but not required.

Pricing data verified Jun 7, 2026. Prices per 1M tokens. See full API documentation for all endpoints and parameters.