. The widget automatically displays pricing for 34 models from 10 providers." } }, { "@type": "Question", "name": "Is the pricing widget free?", "acceptedAnswer": { "@type": "Answer", "text": "Yes, the APIpulse pricing widget is free to embed. It displays accurate, auto-updating pricing data for all major AI API providers." } } ] }
Guide May 27, 2026 · 4 min read

How to Embed Live LLM Pricing in Your Docs

Writing a blog post about AI costs? Building internal docs for your team? Maintaining a README that compares model pricing? Instead of screenshotting pricing tables that go stale in weeks, embed a live widget that updates automatically.

APIpulse offers free, drop-in widgets for pricing tables, model badges, and side-by-side comparisons. One script tag, zero maintenance.

Option 1: Pricing Table

Show a filterable pricing table for any set of providers. Great for comparison articles and internal documentation.

<!-- Pricing table for OpenAI, Anthropic, Google --> <div class="apipulse-widget" data-type="table" data-providers="openai,anthropic,google"></div> <script src="https://getapipulse.com/widget.js" async></script>

Live Preview

You can filter by tier (budget, mid, premium) and switch between dark and light themes with data-theme="light".

Option 2: Model Badge

A compact inline badge showing a single model's pricing. Perfect for README files, inline references, and sidebars.

<!-- Compact pricing badge --> <div class="apipulse-widget" data-type="badge" data-model="openai-gpt4o-mini"></div> <script src="https://getapipulse.com/widget.js" async></script>

Live Preview

Option 3: Side-by-Side Comparison

Compare specific models head to head. The cheapest model is highlighted automatically. Ideal for "which model should I use" content.

<!-- Compare 4 models side by side --> <div class="apipulse-widget" data-type="compare" data-models="openai-gpt5,anthropic-sonnet,google-pro,deepseek-v4-pro"></div> <script src="https://getapipulse.com/widget.js" async></script>

Live Preview

Configuration Options

AttributeValuesDescription
data-typetable, badge, compareWidget type
data-providersopenai, anthropic, google, deepseek, mistral, cohere, together, moonshot, xai, ai21Comma-separated (table only)
data-modelModel ID (e.g. openai-gpt4o-mini)Single model (badge only)
data-modelsComma-separated model IDsModels to compare (compare only)
data-tierbudget, mid, premiumFilter by tier (table only)
data-themedark, lightColor theme. Default: dark

Where to Use These Widgets

Blog posts — Embed a pricing table in your "GPT-5 vs Claude" comparison article. Readers see live prices, not stale screenshots.

Internal docs — Add a model badge next to each provider recommendation in your team's AI guidelines.

README files — Show a compact comparison of the models your project supports, with real pricing.

Developer portals — Embed a full pricing table in your API documentation or developer dashboard.

How It Works

The widget script (widget.js) is under 5KB gzipped. It:

  1. Scans the page for .apipulse-widget elements
  2. Fetches current pricing data from the APIpulse API
  3. Renders the appropriate widget type (table, badge, or comparison)
  4. Respects the data-theme attribute and your site's color scheme

No API key required. No rate limits. The data is cached and updates when we update our pricing database (currently monthly).

Full Calculator Embed

Need more than static pricing? You can also embed the full interactive cost calculator via iframe:

<iframe src="https://getapipulse.com/embed-calculator.html" width="100%" height="600" frameborder="0" loading="lazy" title="AI API Cost Calculator" ></iframe>

Available Model IDs

Use these IDs in data-model and data-models attributes:

ProviderModel IDs
OpenAIopenai-gpt55, openai-gpt5, openai-gpt4o, openai-gpt4o-mini
Anthropicanthropic-opus, anthropic-sonnet, anthropic-haiku
Googlegoogle-gemini3-pro, google-pro, google-flash
DeepSeekdeepseek-v4-pro, deepseek-v4-flash
Mistralmistral-large, mistral-small
Otherscohere-command-r-plus, llama-4-scout, xai-grok3, kimi-k26, ai21-jamba

See the full widget documentation for all model IDs and advanced options.

Try the Widgets Now

Copy any code snippet above and paste it into your site. The widgets work immediately — no signup, no API key.

View All Widgets & Live Previews →

Found this useful? Share it: