API documentation

The Modelglass read API serves the same pricing + ontology data as the comparison site, with full pricing history and the structured feed for operators. Paid tiers require an API key.

Get an API key →

View the machine-readable OpenAPI spec → /v1/openapi.json

Response fields

Responses contain exactly the fields documented in the OpenAPI spec, which marks each data object additionalProperties: false. Open-ended records (capabilities, tier attributes) are the only exceptions. New fields are added to the spec when they're served, without a schema_version bump, so tolerate fields you don't recognise. Every notes field is public commentary written for you (a sale price, a regional caveat); it may be absent, and provenance always lives in source.

Base URL

https://modelglass-api.vercel.app

Authentication

Send your API key as a Bearer token on every /v1 request. Missing key → 401; over your plan limit → 429. Successful responses carry X-RateLimit-Limit/Remaining/Reset headers.

Authorization: Bearer mg_starter_devkey

Endpoints

Method Path Description
GET /v1/meta Artifact version, built_at, content hash, counts
GET /v1/models All models; filter ?provider= ?unit= ?status= ?arch=
GET /v1/models/:modelId One model by model_id (e.g. bfl/flux-1-schnell)
GET /v1/models/:modelId/competitors Closest competitors with current_price and price_delta_ratio; a retired competitor has current_price null and a last_price instead
GET /v1/providers All providers
GET /v1/providers/:slug One provider by slug
GET /v1/benchmarks All benchmark definitions

Pricing units

Every price row carries a unit string. Current values:

per_imageper_megapixelper_secondper_stepper_clipper_1m_tokens_inputper_1m_tokens_outputper_1m_tokensper_1k_tokens_inputper_1k_tokens_outputper_requestper_monthper_creditper_1m_charactersper_minuteper_generationper_1k_requestsper_1m_tokens_citationper_1m_tokens_reasoningper_1m_tokens_cache_readper_1m_tokens_cache_writeper_gpu_second

unit is documented as a string, not a closed list: new units are added without a version bump, so treat a unit you don't recognise as "not comparable", not as an error.

Prompt caching. per_1m_tokens_cache_read and per_1m_tokens_cache_write are prompt-cache rates (cached-input reads and cache writes), on their own tiers next to input and output. They're real prices for cache-heavy workloads, but never a model's headline price.

Headline rows. The MCP pricing feed (modelglass_get_pricing_feed) returns one row per active tier, each with a headline boolean. Rows with headline: false (Batch, Flex, off-peak and cache rates) are real but not the list price. Filter on headline: true before taking the cheapest row per unit.

Plans & rate limits

Plan Pricing history Rate limit
Free Active price only 100 req/day
Starter Full pricing history 10,000 req/day
Pro Full history 100,000 req/day + SLA

Free tier reads the static artifact (no key needed) · browse all model pricing →

Examples

# Metadata
curl -H "Authorization: Bearer mg_starter_devkey" \
  https://modelglass-api.vercel.app/v1/meta

# All models, filtered to one provider
curl -H "Authorization: Bearer mg_starter_devkey" \
  "https://modelglass-api.vercel.app/v1/models?provider=replicate"

# One model (full pricing history on Starter+)
curl -H "Authorization: Bearer mg_starter_devkey" \
  https://modelglass-api.vercel.app/v1/models/bfl/flux-1-schnell