Loading...
Loading...
Programmatic access to model prices, API changes, and webhooks.
Fetch live model prices with a single request.
curl -H "Authorization: Bearer mpl_your_api_key" \
"https://api.modelpricelab.com/v1/prices"| Endpoint | Method | Auth | Description | Limit |
|---|---|---|---|---|
| /v1/prices | GET | API key | Returns current model prices across vendors and platforms. | Plan quota |
| /v1/changes | GET | API key | Returns recent price and API changes with severity and impact. | Plan quota |
| /v1/webhooks | GET | API key | List configured webhook endpoints. | Plan quota |
| /v1/webhooks | POST | API key | Subscribe a URL to price and change events. | Webhook quota |
| /v1/webhooks/{id} | DELETE | API key | Remove a webhook subscription. | Webhook quota |
Verify webhook payloads using HMAC SHA-256.
import { createHmac } from 'node:crypto';
const signature = req.headers['x-mpl-signature'];
const payload = JSON.stringify(req.body);
const expected = createHmac('sha256', WEBHOOK_SECRET)
.update(payload)
.digest('hex');
if (signature !== expected) {
res.status(401).send('Invalid signature');
return;
}Each API key has a daily request quota based on its plan. Requests exceeding the quota return HTTP 429.