modelspec-dev Compare Models API
The Compare Models API from modelspec-dev — 1 operation(s) for compare models.
The Compare Models API from modelspec-dev — 1 operation(s) for compare models.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/modelspec-dev:modelspec-dev-compare-models-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: ModelSpec Compare Models API
version: '2.0'
summary: Decides which AI models fit a job from your requirements, sourced evidence and real cost, and checks them against a compliance policy.
description: 'Start with the compact agent guide https://modelspec.dev/agents.md (version 1-d71e83841e122452). Call decide early with a template-based Spec; refine from reading and recovery hints.
Use when choosing, switching, or checking a model before a task or deploy. POST /v1/decide takes your requirements and returns the models that fit, with reasons, cost per task and ties; when nothing fits, it says what to relax. POST /v1/rank is deprecated: the retired fixed-benchmark ranking, kept for existing callers and never a fallback for decide. POST /v1/policy-check returns, per model and per platform, pass, fail or undetermined against a licence, origin, residency and commercial-use policy, citing the document behind each verdict. After you act on an answer, POST /v1/feedback with a rating (reliable, unreliable, trustworthy, untrustworthy, confusing) and its decision_id; no key.
One call, and no state on your side. Each answer is computed per request from the private bundled catalogue; `build.commit` on every response names the catalogue it was computed from. A request carries a profile or a policy — never a prompt.
Machine data access needs an API key (see x-modelspec-access). GET /v1/health and POST /v1/feedback stay keyless. The free decide page uses the human browser visit gate, with a Turnstile-verified visit token for decide and vocabulary when VISIT_GATE_ENABLED is on. Any key starting `test_` is the sandbox: unlimited, synthetic rows from the real scorer, /v1/rank only.
Without a paid entitlement, policy-check uses public-export evidence. Every check it cannot settle is `undetermined` with `why: tier`, and `determinations.undetermined_for_lack_of_entitlement` counts them. It is never a pass.
Any common HTTP client `User-Agent` works, including Python''s default (`Python-urllib/*`). A `403` with the non-JSON body `error code: 1010` is a refusal at the Cloudflare edge, not from this service. Report it.
Reference: docs/api.md and docs/api-policy-check.md. Generated from the implementation by api/worker/openapi.py.'
license:
name: MIT
url: https://github.com/turbobeest/modelspec
x-error-codes:
- access_not_configured
- access_store_not_configured
- comparison_snapshot_changed
- comparison_snapshot_unavailable
- credits_store_not_configured
- determinations_unavailable
- explanation_unavailable
- export_unavailable
- human_burst_limit
- human_challenge_required
- human_day_limit
- human_gate_unavailable
- human_intent_limit
- human_origin_required
- human_sweep_limit
- insufficient_evidence
- invalid_api_key
- invalid_request
- invalid_spec
- key_revoked
- method_not_allowed
- missing_api_key
- no_match
- no_snapshot
- not_found
- origin_not_allowed
- payload_too_large
- payment_required
- rate_limited
- sandbox_not_available
- snapshot_changed
- snapshot_not_loaded
- snapshot_refused
- snapshot_unavailable
- tier_not_configured
- undetermined_present
- unknown_hardware
- unknown_hosting
- unknown_model
- unknown_platform
- unknown_runtime
- unknown_use_case
- visit_token_expired
- visit_token_invalid
x-transport-error-statuses:
export_unavailable: 502
human_burst_limit: 429
human_challenge_required: 403
human_day_limit: 429
human_gate_unavailable: 503
human_intent_limit: 429
human_origin_required: 401
human_sweep_limit: 429
method_not_allowed: 405
not_found: 404
origin_not_allowed: 404
visit_token_expired: 401
visit_token_invalid: 401
x-max-request-bytes:
/v1/rank: 16384
/v1/decide: 65536
/v1/compare: 65536
/v1/compare-models: 65536
/v1/hardware-fit: 65536
/v1/policy-check: 262144
/v1/signals: 4096
/v1/signals/discovered: 4096
/v1/feedback: 4096
servers:
- url: https://api.modelspec.dev
description: production
security:
- bearer: []
- apiKey: []
tags:
- name: Compare Models
paths:
/v1/compare-models:
post:
operationId: compareModels
summary: Present sourced facts for two to four named models side by side
description: Requires an API key even when ACCESS_ENFORCED is off. Browser visit tokens do not admit it. Costs the decide.full credit weight. The request has only models and accepts no Spec.
security:
- bearer: []
- apiKey: []
parameters:
- name: X-ModelSpec-Snapshot
in: header
required: false
description: The snapshot the caller expects. A mismatch returns 409 snapshot_changed.
schema:
type: string
pattern: ^snap_[A-Za-z0-9:._-]+$
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DecisionModelComparisonRequest'
example:
models:
- anthropic/claude-opus-5-5
- openai/gpt-6-sol
responses:
'200':
description: Model rows in caller order, with facts, offerings, benchmark evidence and registered sources. No rank, score or winner. Whole omitted items are counted without changing retained values.
content:
application/json:
schema:
$ref: '#/components/schemas/DecisionModelComparison'
x-max-response-bytes: 14000
headers:
X-ModelSpec-Snapshot:
description: The verified snapshot that answered (MODEL-159).
schema:
type: string
X-ModelSpec-Snapshot-Stale:
description: Present only when the isolate's latest revalidation failed (network, HTTP error, or a snapshot that failed verification) and an older verified snapshot answered. The value says why.
schema:
type: string
Link:
$ref: '#/components/headers/AgentGuide'
x-modelspec-guide-version:
$ref: '#/components/headers/AgentGuideVersion'
'400':
description: 'Invalid request: two to four distinct model IDs are required. An unknown ID reports its models[n] issue against the active lineup.'
content:
application/json:
schema:
$ref: '#/components/schemas/ModelComparisonRequestRefused'
headers:
Link:
$ref: '#/components/headers/AgentGuide'
x-modelspec-guide-version:
$ref: '#/components/headers/AgentGuideVersion'
'409':
description: 'snapshot_changed: X-ModelSpec-Snapshot names another snapshot than the one answering.'
content:
application/json:
schema:
$ref: '#/components/schemas/ModelComparisonRequestRefused'
headers:
Link:
$ref: '#/components/headers/AgentGuide'
x-modelspec-guide-version:
$ref: '#/components/headers/AgentGuideVersion'
'404':
description: No endpoint at that path. `error.accepted` names the versioned paths.
content:
application/json:
schema:
$ref: '#/components/schemas/TransportError'
headers:
Link:
$ref: '#/components/headers/AgentGuide'
x-modelspec-guide-version:
$ref: '#/components/headers/AgentGuideVersion'
'405':
description: /v1/compare-models takes POST.
content:
application/json:
schema:
$ref: '#/components/schemas/TransportError'
headers:
Link:
$ref: '#/components/headers/AgentGuide'
x-modelspec-guide-version:
$ref: '#/components/headers/AgentGuideVersion'
'413':
description: The body is over 65536 bytes.
content:
application/json:
schema:
$ref: '#/components/schemas/ModelComparisonRequestRefused'
headers:
Link:
$ref: '#/components/headers/AgentGuide'
x-modelspec-guide-version:
$ref: '#/components/headers/AgentGuideVersion'
'502':
description: The published snapshot could not be fetched.
content:
application/json:
schema:
$ref: '#/components/schemas/ModelComparisonRequestRefused'
headers:
Link:
$ref: '#/components/headers/AgentGuide'
x-modelspec-guide-version:
$ref: '#/components/headers/AgentGuideVersion'
'402':
description: Payment required when X402_ENABLED is on.
content:
application/json:
schema:
$ref: '#/components/schemas/PaymentRequired'
headers:
Link:
$ref: '#/components/headers/AgentGuide'
x-modelspec-guide-version:
$ref: '#/components/headers/AgentGuideVersion'
'401':
description: No key while keys are enforced (missing_api_key), or a key that is not ours (invalid_api_key). `error.how_to_get_a_key` says where to get one.
content:
application/json:
schema:
$ref: '#/components/schemas/ModelComparisonAccessRefused'
headers:
Link:
$ref: '#/components/headers/AgentGuide'
x-modelspec-guide-version:
$ref: '#/components/headers/AgentGuideVersion'
'403':
description: 'key_revoked: a key we know and will not serve. Retrying will not help.'
content:
application/json:
schema:
$ref: '#/components/schemas/ModelComparisonAccessRefused'
headers:
Link:
$ref: '#/components/headers/AgentGuide'
x-modelspec-guide-version:
$ref: '#/components/headers/AgentGuideVersion'
'429':
description: 'rate_limited: the key''s daily or per-minute window is spent. States the limit, the window and `resets_at`; `Retry-After` is set.'
content:
application/json:
schema:
$ref: '#/components/schemas/ModelComparisonAccessRefused'
headers:
Link:
$ref: '#/components/headers/AgentGuide'
x-modelspec-guide-version:
$ref: '#/components/headers/AgentGuideVersion'
'500':
description: 'Ours, not the caller''s: the key names a tier the service does not carry (tier_not_configured), or the deployment has no tier table (access_not_configured).'
content:
application/json:
schema:
$ref: '#/components/schemas/ModelComparisonAccessRefused'
headers:
Link:
$ref: '#/components/headers/AgentGuide'
x-modelspec-guide-version:
$ref: '#/components/headers/AgentGuideVersion'
'503':
description: The verified snapshot or access store is unavailable. Retry later.
content:
application/json:
schema:
oneOf:
- oneOf:
- $ref: '#/components/schemas/ModelComparisonSnapshotUnavailable'
- $ref: '#/components/schemas/ModelComparisonRequestRefused'
- $ref: '#/components/schemas/ModelComparisonAccessRefused'
headers:
Retry-After:
description: Seconds before retrying a no_snapshot response.
schema:
type: integer
minimum: 1
Link:
$ref: '#/components/headers/AgentGuide'
x-modelspec-guide-version:
$ref: '#/components/headers/AgentGuideVersion'
tags:
- Compare Models
components:
schemas:
DecisionOfferingRef:
additionalProperties: false
properties:
model:
pattern: ^[a-z0-9][a-z0-9._-]*/[a-z0-9][a-z0-9._-]*$
type: string
provider:
anyOf:
- type: string
- type: 'null'
region:
anyOf:
- type: string
- type: 'null'
tier:
anyOf:
- type: string
- type: 'null'
api_model_id:
anyOf:
- type: string
- type: 'null'
router_slug:
anyOf:
- type: string
- type: 'null'
required:
- model
type: object
ModelComparisonSnapshotUnavailable:
type: object
additionalProperties: false
required:
- comparison_version
- endpoint
- snapshot
- error
- message
properties:
comparison_version:
type: string
enum:
- '1.1'
endpoint:
type: string
enum:
- compare-models
snapshot:
type: 'null'
error:
type: string
enum:
- no_snapshot
message:
type: string
ModelComparisonRequestRefused:
type: object
additionalProperties: false
required:
- comparison_version
- endpoint
- snapshot
- error
properties:
comparison_version:
type: string
enum:
- '1.1'
endpoint:
type: string
enum:
- compare-models
snapshot:
anyOf:
- type: string
pattern: ^snap_[A-Za-z0-9:._-]+$
- type: 'null'
error:
type: object
additionalProperties: false
required:
- code
- message
properties:
code:
type: string
enum:
- invalid_request
- origin_not_allowed
- payload_too_large
- snapshot_changed
- snapshot_refused
- snapshot_unavailable
message:
type: string
issues:
type: array
items:
type: object
requested:
type: string
description: 'snapshot_changed only: the X-ModelSpec-Snapshot sent.'
current:
type: string
description: 'snapshot_changed only: the snapshot that answers now.'
DecisionComparisonOffering:
additionalProperties: false
properties:
offering:
$ref: '#/components/schemas/DecisionOfferingRef'
facts:
items:
$ref: '#/components/schemas/DecisionComparisonFact'
type: array
required:
- offering
- facts
type: object
DecisionFactCitation:
additionalProperties: false
properties:
status:
const: cited
type: string
sources:
items:
$ref: '#/components/schemas/DecisionCitationSource'
minItems: 1
type: array
required:
- status
- sources
type: object
DecisionModelComparisonRequest:
additionalProperties: false
description: Two to four distinct model IDs, in the caller's display order.
properties:
models:
items:
pattern: ^[a-z0-9][a-z0-9._-]*/[a-z0-9][a-z0-9._-]*$
type: string
maxItems: 4
minItems: 2
type: array
uniqueItems: true
required:
- models
type: object
DecisionComparisonModel:
additionalProperties: false
properties:
model:
pattern: ^[a-z0-9][a-z0-9._-]*/[a-z0-9][a-z0-9._-]*$
type: string
lifecycle:
enum:
- active
- deprecated
- retired
type: string
facts:
items:
$ref: '#/components/schemas/DecisionComparisonFact'
type: array
offerings:
items:
$ref: '#/components/schemas/DecisionComparisonOffering'
type: array
evidence:
items:
$ref: '#/components/schemas/DecisionComparisonEvidence'
type: array
required:
- model
- lifecycle
- facts
- offerings
- evidence
type: object
ModelComparisonAccessRefused:
type: object
additionalProperties: false
required:
- comparison_version
- endpoint
- snapshot
- error
properties:
comparison_version:
$ref: '#/components/schemas/ModelComparisonRequestRefused/properties/comparison_version'
endpoint:
$ref: '#/components/schemas/ModelComparisonRequestRefused/properties/endpoint'
snapshot:
$ref: '#/components/schemas/ModelComparisonRequestRefused/properties/snapshot'
error:
$ref: '#/components/schemas/AccessRefused/properties/error'
service_commit:
type: string
export_origin:
type: string
result:
type: array
items: {}
maxItems: 0
DecisionComparisonFact:
additionalProperties: false
properties:
facet:
pattern: ^[a-z][a-z0-9_-]*(\.[a-z0-9_-]+)*$
type: string
state:
enum:
- known
- unknown
- not_disclosed
- requires_contract
type: string
value: {}
unit:
anyOf:
- type: string
- type: 'null'
record_id:
anyOf:
- type: string
- type: 'null'
source_ids:
items:
type: string
type: array
citation:
anyOf:
- $ref: '#/components/schemas/DecisionFactCitation'
- type: 'null'
required:
- facet
- state
- value
- unit
type: object
AccessRefused:
type: object
required:
- schema_version
- error
- result
properties:
schema_version:
type: string
service_commit:
type: string
error:
type: object
properties:
code:
type: string
enum:
- access_not_configured
- access_store_not_configured
- invalid_api_key
- key_revoked
- missing_api_key
- rate_limited
- sandbox_not_available
- tier_not_configured
docs:
type: string
how_to_get_a_key:
type: string
limit:
type: integer
message:
type: string
remaining:
type: integer
resets_at:
type: string
retry_after_seconds:
type: integer
sandbox:
type: string
scope:
type: string
tier:
type: string
upgrade:
type: string
used:
type: integer
window:
type: string
window_seconds:
type: integer
windows:
type: array
items:
$ref: '#/components/schemas/Sharedddf01cbae5c7'
required:
- code
- message
result:
type: array
items: {}
maxItems: 0
DecisionModelComparison:
additionalProperties: false
properties:
comparison_version:
const: '1.1'
default: '1.1'
type: string
endpoint:
const: compare-models
default: compare-models
type: string
snapshot:
pattern: ^snap_[A-Za-z0-9:._-]+$
type: string
models:
items:
$ref: '#/components/schemas/DecisionComparisonModel'
type: array
sources:
items:
$ref: '#/components/schemas/DecisionComparisonSource'
type: array
omitted:
$ref: '#/components/schemas/DecisionComparisonOmitted'
required:
- snapshot
- models
- sources
- omitted
type: object
DecisionComparisonEvidence:
additionalProperties: false
properties:
benchmark:
type: string
value:
type: number
unit:
anyOf:
- type: string
- type: 'null'
record_id:
type: string
source_ids:
items:
type: string
type: array
version:
anyOf:
- type: string
- type: 'null'
effort:
anyOf:
- type: string
- type: 'null'
harness:
anyOf:
- type: string
- type: 'null'
measured_by:
anyOf:
- type: string
- type: 'null'
date:
anyOf:
- type: string
- type: 'null'
subcategory:
anyOf:
- type: string
- type: 'null'
interval:
anyOf:
- maxItems: 2
minItems: 2
prefixItems:
- type: number
- type: number
type: array
- type: 'null'
n:
anyOf:
- type: integer
- type: 'null'
citation:
anyOf:
- $ref: '#/components/schemas/DecisionFactCitation'
- type: 'null'
required:
- benchmark
- value
- unit
- record_id
- source_ids
type: object
TransportError:
type: object
required:
- schema_version
- error
- result
properties:
schema_version:
type: string
service_commit:
type: string
error:
type: object
required:
- code
- message
properties:
code:
type: string
enum:
- export_unavailable
- human_burst_limit
- human_challenge_required
- human_day_limit
- human_gate_unavailable
- human_intent_limit
- human_origin_required
- human_sweep_limit
- method_not_allowed
- not_found
- origin_not_allowed
- payload_too_large
- visit_token_expired
- visit_token_invalid
message:
type: string
accepted:
type: array
items:
type: string
result:
type: array
items: {}
maxItems: 0
PaymentRequired:
type: object
required:
- schema_version
- error
- result
properties:
schema_version:
type: string
service_commit:
type: string
error:
type: object
required:
- accepts
- code
- how_to_pay
- message
- payTo
- price
- resource
- terms_url
- x402Version
properties:
accepts:
type: array
items:
type: object
properties:
amount:
type: string
asset:
type: string
description:
type: string
extra:
type: object
properties:
credits:
type: integer
name:
type: string
version:
type: string
required:
- credits
- name
- version
maxAmountRequired:
type: string
maxTimeoutSeconds:
type: integer
mimeType:
type: string
network:
type: string
payTo:
type: string
resource:
type: string
scheme:
type: string
required:
- amount
- asset
- description
- extra
- maxAmountRequired
- maxTimeoutSeconds
- mimeType
- network
- payTo
- resource
- scheme
code:
type: string
how_to_pay:
type: string
message:
type: string
packs:
type: array
items:
type: object
properties:
credits:
type: integer
name:
type: string
payTo:
type: string
price:
type: object
properties:
amount:
type: string
asset:
type: string
atomic:
type: integer
currency:
type: string
network:
type: string
usd:
type: integer
required:
- amount
- asset
- atomic
- currency
- network
- usd
required:
- credits
- name
- payTo
- price
payTo:
type: string
price:
type: object
required:
- amount
- asset
- atomic
- credits
- currency
- network
- placeholder
- placeholder_note
- usd
properties:
amount:
type: string
asset:
type: string
atomic:
type: integer
credits:
type: integer
currency:
type: string
network:
type: string
placeholder:
type: boolean
placeholder_note:
type: string
usd:
type: number
resource:
type: string
terms_url:
type: string
x402Version:
type: integer
result:
type: array
items: {}
maxItems: 0
DecisionComparisonSource:
additionalProperties: false
properties:
id:
type: string
url:
type: string
required:
- id
- url
type: object
DecisionCitationSource:
additionalProperties: false
properties:
source_id:
type: string
url:
pattern: ^https?://\S+$
type: string
snapshot_ref:
pattern: ^sha256:[0-9a-f]{64}$
type: string
retrieved_at:
anyOf:
- type: string
- type: 'null'
resolved_urls:
items:
pattern: ^https?://\S+$
type: string
type: array
required:
- source_id
- url
- snapshot_ref
type: object
DecisionComparisonOmitted:
additionalProperties: false
properties:
facts:
minimum: 0
type: integer
offerings:
minimum: 0
type: integer
evidence:
minimum: 0
type: integer
required:
- facts
- offerings
- evidence
type: object
Sharedddf01cbae5c7:
properties:
limit:
type: integer
remaining:
type: integer
resets_at:
type: string
retry_after_seconds:
type: integer
scope:
type: string
used:
type: integer
window:
type: string
window_seconds:
type: integer
required:
- limit
- remaining
- resets_at
- retry_after_seconds
- scope
- used
- window
- window_seconds
type: object
headers:
AgentGuideVersion:
description: Version of the byte-stable guide.
schema:
type: string
const: 1-d71e83841e122452
AgentGuide:
description: Compact agent guide.
schema:
type: string
const: <https://modelspec.dev/agents.md>; rel="describedby"
securitySchemes:
bearer:
type: http
scheme: bearer
description: 'Authorization: Bearer <key>. Takes precedence.'
apiKey:
type: apiKey
in: header
name: X-API-Key
description: 'X-API-Key: <key>. Never in the query string.'
signalHmac:
type: apiKey
in: header
name: X-ModelSpec-Signature
description: sha256=<HMAC-SHA256 of the exact request bytes>.
signalReadKey:
type: http
scheme: bearer
description: Repository-only key for pending and acknowledgement automation.
visitToken:
type: apiKey
in: header
name: X-ModelSpec-Visit-Token
description: Human browser credential from the Turnstile-verified visit gate. Bound to the visitor and allowed site origin; admits only decide and vocabulary. Machine callers use an API key.
x-modelspec-access:
status: wired; enforced
ticket: MODEL-69
enforced: true
switch: ACCESS_ENFORCED in api/worker/wrangler.jsonc
key_store_bound: true
effect_today: 'Every machine data endpoint needs an API key: a request without one is refused 401 missing_api_key, naming https://modelspec.dev/pricing. GET /v1/health and POST /v1/feedback stay keyless. The free decide page uses the human browser visit gate: with VISIT_GATE_ENABLED, a Turnstile-verified visit token admits only decide and vocabulary for its bound visitor and origin. The ACCESS key store is bound. Existing live keys are checked against it; test_ keys use the sandbox.'
policy_check_paid_entitlement:
status: granted to a presented key with remaining credits, or a credit-exempt paid tier
granted_by: entry.py::_entitlement
effect_today: 'Public-export evidence has determinations.entitlement public_export; checks they cannot settle come back undetermined with why: tier and available_in_tier: paid. A funded key reads the determinations, or gets HTTP 503 determinations_unavailable when the store cannot be read. A credit-exempt paid tier also reads the determinations without a balance. Other keys with zero credits get the public-export answer plus credits.exhausted.'
present_key_as:
- 'Authorization: Bearer <key>'
- 'X-API-Key: <key>'
never: a key in the query string
policy_version: access-v1
sandbox_prefix: test_
sandbox_endpoints:
# --- truncated at 32 KB (33 KB total) ---
# Full source: https://artifacts.apis.io/modelspec-dev/openapi/modelspec-dev-compare-models-api-openapi.yml