Skip to content

API Documentation

Access real-time rankings, scores, pricing, and reviews for 350+ AI models. Build dashboards, integrate widgets, or power your own AI comparison tool.

Base URL

All API requests go to the following base URL. Every endpoint is prefixed with /v1.

text
https://api.lmmarketcap.com/v1

Authentication

Pass your API key in the X-API-Key header with every request. You can get a free key from your developer dashboard.

curl https://api.lmmarketcap.com/v1/models \
  -H "X-API-Key: YOUR_API_KEY"

API Key Tiers

Every key starts on the Free tier. Upgrade anytime from your developer dashboard -- no code changes needed. The only difference between tiers is the daily request limit.

TierRequests / dayPriceBest for
Free100$0Prototyping, personal projects
Dev10,000$29/moProduction apps, startups
Pro100,000$199/moHigh-traffic sites, enterprise integrations
EnterpriseCustomContact usSLA, dedicated support, custom data feeds

Rate Limiting

Every response includes rate limit headers so you always know where you stand. Limits reset daily at midnight UTC.

HeaderDescription
X-RateLimit-LimitYour plan's daily request cap
X-RateLimit-RemainingRequests left in the current window
X-RateLimit-ResetUTC epoch seconds when the window resets
Retry-AfterSeconds until you can retry (only on 429 responses)

When you hit the limit, the API returns 429 Too Many Requests. The best practice is to check X-RateLimit-Remaining and back off before hitting zero. Our SDK handles this automatically with exponential backoff.

Quick Example

Get the top 5 coding models in a single request:

curl "https://api.lmmarketcap.com/v1/rankings/coding?limit=5" \
  -H "X-API-Key: YOUR_API_KEY"

Error Handling

Errors follow a consistent format. The code field is machine-readable, and message is a human-friendly explanation.

json
{
  "error": {
    "code": "not_found",
    "message": "No model found with slug 'gpt-5-turbo'. Did you mean 'gpt-4-turbo'?"
  }
}
StatusCodeMeaning
400bad_requestInvalid parameters. Check the details field.
401unauthorizedMissing or invalid API key.
403forbiddenYour plan does not allow this action.
404not_foundThe requested resource does not exist.
429rate_limitedDaily rate limit exceeded. Check Retry-After header.

Pagination

List endpoints use cursor-based pagination. Each response includes a pagination object. To get the next page, pass the next_cursor value as the cursor query parameter.

json
{
  "data": [...],
  "pagination": {
    "next_cursor": "eyJpZCI6MTAxfQ==",
    "has_more": true,
    "total": 847
  }
}

When has_more is false, you have reached the last page. The default page size is 20; you can set it to anything between 1 and 100 with the limit parameter.

Next Steps