/api/public/pricingPrice a workload. Main endpoint for app integrations and server-side product forms.
/api/public/pricesRead provider prices. Source-backed price rows with billing units, URLs, and observed dates.
/api/public/providersGroup by provider. Provider catalog for pickers, filters, and source review workflows.
/api/public/engineInspect engine rules. Inputs, guardrails, pricing source details, and endpoint inventory.
Auth
Authenticate production calls
The website can call the pricing engine anonymously. Production integrations should use an API key so requests get a higher quota and can be tracked per workspace.
Create keys from the signed-in workspace. The full key is shown once, then only the prefix remains visible.
- Preferred header: Authorization: Bearer pg_live_...
- Fallback header: X-Price-Gouge-Key: pg_live_...
- Use pg_test_ keys for local and test environments.
- Store keys server-side. Do not ship them in browser bundles.
curl -X POST https://pricegouge.me/api/public/pricing \
-H 'Authorization: Bearer pg_live_your_key' \
-H 'Content-Type: application/json' \
-d '{
"query": "Process 1M documents per month under $500",
"monthlyBudgetUsd": 500
}'Limits
Read rate-limit headers
Every public API response includes rate-limit headers. Anonymous requests are meant for demos and public pages. API-key requests are the production path.
- X-RateLimit-Limit is the request limit for the current window.
- X-RateLimit-Remaining is the number of requests left.
- X-RateLimit-Reset is the reset time as a Unix timestamp.
- 429 responses include a JSON body with the limit and resetAt value.
{
"error": "Rate limit exceeded.",
"limit": 60,
"resetAt": "2026-07-08T19:00:00.000Z"
}Start with one endpoint
Most app integrations should start with POST /api/public/pricing. Send the workload in plain English, add any structured cost drivers you already know, and render the returned pricingNote plus comparison options.
The endpoint does not require auth. It returns public provider prices, deterministic strategy costs, source links, and a short recommendation that is safe to show in a product UI.
- Use GET /api/public/pricing?q=... for shareable URLs and prototypes.
- Use POST /api/public/pricing for product forms, calculators, and server-side integrations.
- Send q or query. Add budget, token, document, cache, GPU, storage, and egress fields only when you know them.
- Use pricingNote for the human-readable answer and comparison.options for the actual weekly, monthly, and yearly costs.
- Use trace and sourceContext when you need to show where the estimate came from.
const response = await fetch("https://pricegouge.me/api/public/pricing", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
query: "Process 1M documents per month under $500 with summaries and citations.",
monthlyBudgetUsd: 500,
monthlyDocuments: 1000000,
cacheHitRate: 0.72
})
});
if (!response.ok) {
throw new Error("Price Gouge pricing request failed");
}
const result = await response.json();
console.log(result.pricingNote.headline);
console.log(result.comparison.options.map((option) => [option.name, option.monthlyUsd]));Create an API key
Anonymous pricing calls are fine for the public website, demos, and prototypes. Production integrations should use a workspace API key so requests get a higher quota and can be tracked later.
Create a key from your signed-in workspace. Price Gouge shows the full key once, stores only a hash, and keeps the visible prefix for later review.
- Send the key with Authorization: Bearer pg_live_... for production calls.
- X-Price-Gouge-Key is supported as a fallback header.
- Use pg_test_ keys for local and test environments.
- Keep keys on your server. Do not expose them in browser code.
curl -X POST https://pricegouge.me/api/public/pricing \
-H 'Authorization: Bearer pg_live_your_key' \
-H 'Content-Type: application/json' \
-d '{"query":"Process 1M documents per month under $500"}'Handle rate limits
Every public API response includes rate-limit headers. Anonymous pricing requests have a tighter quota. API-key requests get a higher per-key quota.
- X-RateLimit-Limit: the limit for the current window.
- X-RateLimit-Remaining: requests left in the current window.
- X-RateLimit-Reset: Unix timestamp for the next reset.
- 429 responses include error, limit, and resetAt fields.
{
"error": "Rate limit exceeded.",
"limit": 60,
"resetAt": "2026-07-08T19:00:00.000Z"
}Request body
You can send only a sentence and still get a result. Structured fields make the result more useful, especially when you already know monthly volume or budget limits.
- query or q: the workload in plain English.
- workloadKind: optional preset such as documents, software-development, data-heavy, research, support, creative-media, or custom.
- monthlyBudgetUsd: budget ceiling used by the recommendation.
- monthlyDocuments, monthlyInputTokens, monthlyOutputTokens, and monthlyToolCalls: scale drivers.
- cacheHitRate: decimal from 0 to 1, for example 0.72.
- gpuHours, storageGb, and egressGb: infrastructure drivers for GPU-hosted, local, and cloud routes.
{
"query": "What is the cheapest production architecture under $500/month?",
"workloadKind": "documents",
"monthlyBudgetUsd": 500,
"monthlyDocuments": 1000000,
"monthlyInputTokens": 2500000000,
"monthlyOutputTokens": 180000000,
"monthlyToolCalls": 250000,
"cacheHitRate": 0.72,
"gpuHours": 96,
"storageGb": 2048,
"egressGb": 512
}Render the result
Render the structured fields first. The recommendation text is useful, but the costs should always come from comparison.options, visualizations, and trace.
This keeps your UI stable even when the optional LLM explanation changes wording.
- pricingNote.headline: one sentence recommendation.
- pricingNote.cheapest and pricingNote.recommended: cost pills for the top of a card.
- pricingNote.why, architecture, and avoid: bullet lists for the explanation.
- comparison.options: strategy rows with weeklyUsd, monthlyUsd, yearlyUsd, fit, providerIds, pricingModels, and cost components.
- visualizations.costRanking: chart-ready strategy rows.
- trace.missingInputs: fields to ask the user for next.
type PricingResult = {
pricingNote: {
headline: string;
cheapest: { name: string; monthlyUsd: number };
recommended: { name: string; monthlyUsd: number };
why: string[];
architecture: string[];
avoid: string[];
};
comparison: {
options: Array<{
id: string;
name: string;
monthlyUsd: number;
yearlyUsd: number;
providerIds: string[];
}>;
};
trace: {
missingInputs: string[];
sourceRows: Array<{ id: string; labels: string[]; monthlyUsd: number }>;
};
};
export function PricingSummary({ result }: { result: PricingResult }) {
return (
<section>
<h2>{result.pricingNote.headline}</h2>
<p>Cheapest: {result.pricingNote.cheapest.name}</p>
<p>Recommended: {result.pricingNote.recommended.name}</p>
<ul>
{result.pricingNote.why.map((reason) => (
<li key={reason}>{reason}</li>
))}
</ul>
</section>
);
}Response map
The pricing response is built for product UIs and backend integrations. You do not need to parse a paragraph to find the answer.
- pricingNote is the UI-ready strategy note.
- comparison is the CostComparison object with strategy costs built from published provider prices.
- visualizations contains chart-ready costRanking rows plus cheapest and recommended ids.
- engine explains the pricing source, workload classification mode, advisor mode, and guardrails.
- trace shows selected strategies, normalized inputs, missing inputs, assumptions, and source rows.
- sourceContext reports current verified price counts and source freshness.
- llmContext and llm explain what the LLM was allowed to do. The LLM can parse workload text and help phrase guidance. It cannot set numeric prices, provider records, billing units, or cost components.
{
"pricingNote": {
"headline": "Hybrid router is the safest default for this workload at $202/month.",
"cheapest": { "id": "open-model-api", "name": "Open-model API", "monthlyUsd": 23.27 },
"recommended": { "id": "hybrid-router", "name": "Hybrid router", "monthlyUsd": 202.32 },
"why": ["Routine work stays on cheaper open-model lanes."],
"architecture": ["Default lane: Open-model API for routine requests."],
"avoid": ["Frontier API only is over budget for routine work."]
},
"comparison": {
"options": [
{ "id": "open-model-api", "name": "Open-model API", "monthlyUsd": 23.27 },
{ "id": "hybrid-router", "name": "Hybrid router", "monthlyUsd": 202.32 }
]
},
"visualizations": {
"recommendedStrategyId": "hybrid-router",
"cheapestStrategyId": "open-model-api",
"costRanking": []
},
"trace": {
"missingInputs": ["Monthly request or token volume"],
"sourceRows": [{ "id": "deepseek-v4-flash" }]
},
"sourceContext": {
"priceRows": "<current verified price count>",
"providers": "<current provider count>",
"officialSources": "<current source count>",
"latestObservedAt": "YYYY-MM-DD"
},
"llm": {
"provider": "Vercel AI Gateway",
"notUsedFor": ["numeric prices", "provider source records", "billing unit calculations"]
}
}Use raw provider prices
Use the price and provider catalog endpoints when your app needs a searchable source table, provider picker, or manual review workflow instead of a full workload estimate.
Each visible price keeps its provider, product, billing unit, formatted price, source URL, observedAt date, and notes. Counts and dates are live values, so do not hard-code them in your UI.
- GET /api/public/prices returns verified public price rows.
- GET /api/public/providers groups matching public prices by provider.
- category filters lanes such as frontier_api, open_model_api, cloud_ai, gpu_hosting, subscription, storage_network, fine_tuning, gateway, and credit_billing.
- provider accepts exact names and common cloud aliases such as AWS, GCP, and Azure.
- billingUnit narrows rows to models such as per_1m_tokens, per_gpu_hour, per_gb_egress, monthly_subscription, credit_balance, and pass_through.
- q searches provider, product, billing unit, price, source, notes, and gouge flags.
curl 'https://pricegouge.me/api/public/prices?q=claude'
curl 'https://pricegouge.me/api/public/prices?category=gpu_hosting&provider=Lambda&q=H100'
curl 'https://pricegouge.me/api/public/prices?provider=GCP'
curl 'https://pricegouge.me/api/public/providers?category=gpu_hosting&q=H100'
curl 'https://pricegouge.me/api/public/providers?provider=GCP'
curl 'https://pricegouge.me/api/public/providers?billingUnit=per_gb_egress'Provider price row shape
Price rows are the lowest-level public data. Show them when a user wants to audit the math, compare a provider directly, or export source evidence.
- Token APIs publish input, cached input, output, cache write, request, or batch fields when available.
- GPU providers publish hourly, minute, storage, egress, training, or credit fields when public.
- Subscription rows publish monthly price fields and skip contact-sales plans unless a numeric public price exists.
- sourceContext lets clients display catalog size, provider count, official source count, latest observed date, and freshness.
{
"prices": [
{
"provider": "Fireworks AI",
"product": "GLM 5.2 Standard",
"category": "open_model_api",
"billingUnit": "per_1m_tokens",
"price": "$1.4/$4.4 per 1M",
"inputUsdPer1M": 1.4,
"cachedInputUsdPer1M": 0.14,
"outputUsdPer1M": 4.4,
"sourceUrl": "https://docs.fireworks.ai/serverless/pricing",
"observedAt": "YYYY-MM-DD",
"source": {
"name": "Fireworks pricing",
"url": "https://docs.fireworks.ai/serverless/pricing",
"observedAt": "YYYY-MM-DD"
}
}
],
"sourceContext": {
"priceRows": "<current verified price count>",
"providers": "<current provider count>",
"officialSources": "<current source count>",
"latestObservedAt": "YYYY-MM-DD"
},
"filters": { "category": "open_model_api", "q": "GLM" },
"total": 1,
"unfilteredTotal": "<current catalog price count>",
"generatedAt": "ISO timestamp"
}Use presets before pricing
Use strategy search for empty states, starter prompts, and workload pickers. It returns recommendation previews and source price examples, but it does not replace /api/public/pricing for actual costs.
- GET /api/public/strategies lists workload presets.
- workloadKind narrows the response to one preset.
- q searches labels, summaries, example workload questions, cost-driver fields, recommendation headlines, gouge reasons, and provider ids.
- sourcePrices includes preview rows with formatted price, official URL, and observed date.
- Use exampleQueries as one-click prompts in product UIs.
curl 'https://pricegouge.me/api/public/strategies?workloadKind=documents&q=document'Handle edge cases
Treat this like a pricing system, not a chatbot. Show source dates, ask for missing inputs, and avoid pretending a stale or incomplete source is exact.
- If trace.missingInputs is not empty, show a small prompt for the missing volume, latency, budget, or quality bar.
- If sourceContext reports stale or due sources, keep the observedAt date visible.
- If a provider only publishes contact-sales pricing, do not turn that into a fake number.
- Use comparison.options for cost math. Do not calculate from pricingNote text.
- Cache common results, but refresh when sourceContext.latestObservedAt changes.
const missing = result.trace.missingInputs ?? [];
if (missing.length > 0) {
showFollowUpPrompt(missing);
}
for (const option of result.comparison.options) {
renderStrategyCost({
label: option.name,
monthlyUsd: option.monthlyUsd,
yearlyUsd: option.yearlyUsd,
providerIds: option.providerIds
});
}Endpoint reference
These are the public endpoints behind the site. The pricing endpoint is the main integration point; the others support catalogs, source checks, guides, and demos.
- GET /api/public/engine explains the pricing engine, LLM role, guardrails, accepted inputs, and public endpoints.
- GET /api/public/pricing?q=... returns a shareable natural-language pricing run.
- POST /api/public/pricing prices a workload from app forms and API clients.
- GET /api/public/prices returns verified public price rows with sourceContext and observed dates.
- GET /api/public/providers groups matching public prices by provider.
- GET /api/public/feeds reports source freshness and scheduled source checks.
- GET /api/public/strategies returns workload presets, sourcePrices, and exampleQueries.
- GET /api/public/demo/router?q=... returns a shareable routing demo.
- POST /api/public/demo/router accepts query without workloadKind and models frontier, open-model, and batch routing shares.
- GET /api/public/guides returns guide tracks, workload decisions, official references, and provider source links.
- GET /api/public/content returns content previews, raw sectionIds, and sectionDetails with labels, URLs, item counts, and source counts; section plus slug returns one full article.
curl https://pricegouge.me/api/public/engine
curl 'https://pricegouge.me/api/public/pricing?q=Estimate%20one%20million%20documents%20under%20%24500'
curl -X POST https://pricegouge.me/api/public/pricing \
-H 'Content-Type: application/json' \
-d '{"q":"Estimate the monthly cost of processing one million documents."}'
curl https://pricegouge.me/api/public/feeds
curl https://pricegouge.me/api/public/guides
curl 'https://pricegouge.me/api/public/content?section=docs&slug=public-pricing-api'