Data API
Programmatic access to stored price records with source links where available, published API changes, and webhooks.
Quick start
Fetch stored model price records with a single request.
curl -H "Authorization: Bearer mpl_your_api_key" \
"https://api.modelpricelab.com/v1/prices"Endpoint reference
| Endpoint | Method | Auth | Description | Limit |
|---|---|---|---|---|
| /v1/prices | GET | API key | Returns stored model price records across vendors and platforms. | API Free or current paid entitlement |
| /v1/changes | GET | API key | Returns published price and API changes; incidents are excluded by default. | Current paid entitlement required |
| /v1/webhooks | GET | API key | List configured webhook endpoints. | Current paid entitlement required |
| /v1/webhooks | POST | API key | Subscribe an HTTPS URL to change.alert events. | Current paid entitlement required |
| /v1/webhooks/{id} | DELETE | API key | Remove a webhook subscription. | Current paid entitlement required |
| /mcp | POST | API key | Read-only MCP endpoint (Streamable HTTP): search_models, list_prices, list_changes tools. | Current paid entitlement required |
MCP server (experimental)
Bring the Data API into MCP clients (Claude, Cursor, ...): three read-only tools — search_models, list_prices, list_changes — with semantics identical to the REST endpoints, the same API key, and the same daily quota. Requires a current Developer plan.
curl -X POST "https://api.modelpricelab.com/mcp" \
-H "Authorization: Bearer $MPL_KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize",
"params":{"protocolVersion":"2025-06-18",
"capabilities":{},
"clientInfo":{"name":"curl","version":"0"}}}'{
"mcpServers": {
"modelpricelab": {
"url": "https://api.modelpricelab.com/mcp",
"headers": {
"Authorization": "Bearer mpl_your_api_key"
}
}
}
}Stateless, POST-only JSON responses (no SSE channel); tools/call payloads mirror /v1/prices and /v1/changes, including next_cursor pagination.
Webhook signature verification
Only accounts on a current Developer plan receive deliveries. Verify the exact raw body with HMAC SHA-256 from x-mpl-signature (sha256=…).
import { createHmac, timingSafeEqual } from 'node:crypto';
const signature = req.headers['x-mpl-signature'];
// Capture the exact raw UTF-8 request bytes before JSON parsing.
const rawBody = req.rawBody;
const expected = 'sha256=' + createHmac('sha256', WEBHOOK_SECRET)
.update(rawBody)
.digest('hex');
const valid = typeof signature === 'string'
&& signature.length === expected.length
&& timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
if (!valid) {
res.status(401).send('Invalid signature');
return;
}Rate limits & quotas
Each API key has a daily request quota based on its plan. Requests exceeding the quota return HTTP 429.
Quotas reset daily at UTC midnight. When exhausted, buy a top-up pack ($5 / 50,000 requests / 30 days, stackable) to keep calling immediately — responses then carry X-RateLimit-Topup: true. GET /v1/usage reports balance and reset time at any time (introspection is unmetered).
curl "https://api.modelpricelab.com/v1/usage" -H "Authorization: Bearer $MPL_KEY"
# → { "plan": "developer", "daily_quota": { "limit": 10000, "remaining": 9962,
# "reset_at": "2026-10-06T00:00:00Z" }, "topup": { "remaining": 49997 } }