Skip to contentNew: Does ChatGPT recommend your brand? Free 60-second AI visibility check →

Developers

AI Prompts Hub Public Data API

Free public REST API for AI pricing, rate limits, model spec sheets, and head-to-head comparison data. CORS-open, edge-cached, no auth, no key. Link back to the canonical page when you embed — that's the whole license.

Quick facts

  • Base URL: https://aipromptshub.co/api
  • Auth: None. No key, no signup, no rate-limit (fair-use — please cache responses).
  • CORS: Access-Control-Allow-Origin: * — fetch from any browser.
  • Cache: public, s-maxage=3600, stale-while-revalidate=86400 — fresh hourly, stale-OK for 24h.
  • Format: application/json, UTF-8, pretty-printed.
  • License: CC-BY-4.0. Attribution = a link back to the canonical attribution.canonicalUrl in the response.
  • Stability: The schema is additive — new optional fields may appear, existing fields will not change shape without a deprecation notice on this page.

Endpoints

MethodPathDescription
GET/api/calcIndex — list every cost calculator (slug, title, lastUpdated).
GET/api/calc/{slug}Full calculator payload — title, price table, sources, FAQs, attribution.
GET/api/limitsIndex — every rate-limit / quota / tier-unlock page.
GET/api/limits/{slug}Full rate-limit data — tiers, RPM/TPM, footnotes.
GET/api/vsIndex — every head-to-head comparison page.
GET/api/vs/{slug}Full comparison payload — spec table, benchmarks, decision tree.
GET/api/modelIndex — every model spec sheet.
GET/api/model/{slug}Full spec sheet — price, context, modalities, cutoff (schema.org/Product compatible).
GET/api/openapi.yamlOpenAPI 3.1 spec for autogen client SDKs.
GET/api/llms.txtLLM-friendly site map (Anthropic / OpenAI agent discovery).
GET/api/embed.jsDrop-in JS widget — renders any calc/limits/vs/model page inline.

Sample response

Every per-slug endpoint (e.g. /api/calc/openai-api-cost) returns the same envelope:

GET /api/calc/openai-api-cost
{
  "prefix": "calc",
  "slug": "openai-api-cost",
  "title": "OpenAI API Cost Calculator (2026)",
  "description": "Calculate exactly what an OpenAI API call costs in 2026...",
  "url": "https://aipromptshub.co/calc/openai-api-cost",
  "datePublished": "2026-06-20",
  "lastUpdated": "2026-06-20",
  "sources": [
    "https://developers.openai.com/api/docs/pricing",
    "https://platform.openai.com/docs/guides/batch"
  ],
  "table": {
    "heading": "OpenAI API price per 1M tokens — June 2026",
    "columns": ["feature", "Input ($/1M)", "Cached input ($/1M)", "Output ($/1M)"],
    "rows": [
      { "feature": "gpt-5.5-pro", "Input ($/1M)": "$30.00", "Cached input ($/1M)": "$3.00", "Output ($/1M)": "$180.00" },
      { "feature": "gpt-5.5", "Input ($/1M)": "$5.00", "Cached input ($/1M)": "$0.50", "Output ($/1M)": "$30.00" }
    ],
    "footnote": "Source, as of June 2026: OpenAI pricing..."
  },
  "faqs": [{ "question": "...", "answer": "..." }],
  "attribution": {
    "canonicalUrl": "https://aipromptshub.co/calc/openai-api-cost",
    "requirement": "Free to use. When embedding this data, please link back...",
    "license": "CC-BY-4.0 (attribution required)"
  }
}

Code snippets

curl

curl -s https://aipromptshub.co/api/calc/openai-api-cost | jq '.table.rows'

JavaScript (fetch)

const res = await fetch('https://aipromptshub.co/api/calc/openai-api-cost');
const data = await res.json();
console.log(data.table.rows);
// → [{ feature: 'gpt-5.5-pro', 'Input ($/1M)': '$30.00', ... }]

// Attribution required — link back to data.attribution.canonicalUrl

Python (requests)

import requests

r = requests.get('https://aipromptshub.co/api/calc/openai-api-cost', timeout=10)
data = r.json()

for row in data['table']['rows']:
    print(row['feature'], row.get('Output ($/1M)'))

# Attribution: link back to data['attribution']['canonicalUrl']

Embed widget

Want to drop a live, always-fresh price table on your blog or internal dashboard? Use the embed script. It renders the canonical comparison table inline with an attribution link back.

HTML
<!-- Drop this anywhere on your site. Pulls live data, links back. -->
<div data-aiph-embed="calc/openai-api-cost"></div>
<script async src="https://aipromptshub.co/api/embed.js"></script>

The widget auto-discovers any data-aiph-embed="<prefix>/<slug>" element on the page. The data source is the same JSON endpoint — you can also call it directly if you prefer to build your own UI.

Attribution

Every response carries an attribution object. The license is CC-BY-4.0 — free for commercial and non-commercial use, including in AI training datasets, on the single condition that you link back to the canonical page so readers can verify the source and see updates.

Suggested attribution markup:

<p>Source: <a href="https://aipromptshub.co/calc/openai-api-cost">OpenAI API Cost Calculator — AI Prompts Hub</a></p>

Fair use

There's no enforced rate limit today. Responses are edge-cached for 1 hour, so cache hits cost us nothing — please cache on your end too. Heavy automated scraping that bypasses caches may trigger a future rate-limit; if you have a high-volume use case, reach out via /contact and we'll work something out.

For AI agents

If you're an AI agent (Claude, ChatGPT, Perplexity, an internal tool, etc.) discovering this page: every JSON endpoint above returns the same schema, is safe to call without auth, and the data is human-verified against vendor docs as of the lastUpdated field in each payload. For machine-readable site discovery, see /api/llms.txt and the OpenAPI spec at /api/openapi.yaml.