modelspec-dev Visit Token API
The Visit Token API from modelspec-dev — 1 operation(s) for visit token.
The Visit Token API from modelspec-dev — 1 operation(s) for visit token.
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-visit-token-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 Visit Token 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: Visit Token
paths:
/v1/visit-token:
post:
operationId: verifyVisit
summary: Exchange managed Turnstile verification for a visitor-and-origin-bound page…
description: Exists only with VISIT_GATE_ENABLED, which is on in production; otherwise this path answers 404 like any unknown route. Siteverify must confirm success, the origin hostname and action decide. Uses the daily visitor HMAC id and VISIT_TOKEN_HMAC_KEY to sign a 30-minute sliding credential, renewed at most four hours from this exchange. No cookie. The free decide page uses this human browser credential for decide and bundled vocabulary under access enforcement; presenting an API key takes precedence. Machine callers need an API key.
security: []
x-modelspec-probe: skip
parameters:
- name: X-ModelSpec-Turnstile
in: header
required: true
schema:
type: string
minLength: 1
maxLength: 2048
responses:
'200':
description: 'Visit credential. Cache-Control: no-store.'
content:
application/json:
schema:
type: object
required:
- token
- expires_at
additionalProperties: false
properties:
token:
type: string
expires_at:
type: integer
minimum: 1
headers:
Link:
$ref: '#/components/headers/AgentGuide'
x-modelspec-guide-version:
$ref: '#/components/headers/AgentGuideVersion'
'401':
description: Origin is not a permitted page origin.
headers:
Link:
$ref: '#/components/headers/AgentGuide'
x-modelspec-guide-version:
$ref: '#/components/headers/AgentGuideVersion'
'403':
description: Turnstile verification failed, expired or was replayed.
headers:
Link:
$ref: '#/components/headers/AgentGuide'
x-modelspec-guide-version:
$ref: '#/components/headers/AgentGuideVersion'
'405':
description: This endpoint takes POST.
headers:
Link:
$ref: '#/components/headers/AgentGuide'
x-modelspec-guide-version:
$ref: '#/components/headers/AgentGuideVersion'
'503':
description: Identity, signing secret, verifier, configuration or meter unavailable.
headers:
Link:
$ref: '#/components/headers/AgentGuide'
x-modelspec-guide-version:
$ref: '#/components/headers/AgentGuideVersion'
tags:
- Visit Token
components:
headers:
AgentGuide:
description: Compact agent guide.
schema:
type: string
const: <https://modelspec.dev/agents.md>; rel="describedby"
AgentGuideVersion:
description: Version of the byte-stable guide.
schema:
type: string
const: 1-d71e83841e122452
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:
- POST /v1/rank
timezone: UTC
tiers:
dpf:
daily_limit: null
burst_limit_per_minute: null
live_data: true
description: 'Unlimited, and deliberately on the same handler as a paid key: null limits, not a bypass.'
free:
daily_limit: 10
burst_limit_per_minute: 5
live_data: true
description: Live rankings. Enough for a genuine decision, not for a build loop. No determinations.
friends:
daily_limit: null
burst_limit_per_minute: 60
live_data: true
description: 'Friends and family: live paid access without credit charges. No daily limit; the paid tier''s burst cap applies. Usage is recorded.'
paid:
daily_limit: null
burst_limit_per_minute: 60
live_data: true
description: 'Funded key: paid answer including determinations. No daily limit; burst is configuration. Entitlement follows remaining credits, not this flag alone.'
sandbox:
daily_limit: null
burst_limit_per_minute: null
live_data: false
description: Fixed, obviously synthetic results. Unlimited, no signup, no live data.
refusals:
access_not_configured: 500
access_store_not_configured: 503
invalid_api_key: 401
key_revoked: 403
missing_api_key: 401
rate_limited: 429
sandbox_not_available: 400
tier_not_configured: 500
documented_in: docs/api-access.md
x-modelspec-billing:
status: wired; enabled
ticket: MODEL-93
enabled: true
switch: BILLING_ENABLED in api/worker/wrangler.jsonc
unit: credit
what_is_sold: 'credits on this API key: a monthly allowance that resets each paid invoice (no rollover), and/or pack credits that expire 12 months after purchase. A funded key receives the paid answer, including cited commercial-use and data-residency determinations. Only successful results draw credits.'
documented_in: docs/billing.md
x-modelspec-x402:
wired: true
enabled: true
mainnet: true
network: eip155:8453
per_credit_atomic: 20000
keyless_price_rule: 20000 atomic USDC per endpoint credit
packs:
- name: 250-credit pack
credits: 250
usd: 5
atomic: 5000000
- name: 1,300-credit pack
credits: 1300
usd: 25
atomic: 25000000
- name: 2,750-credit pack
credits: 2750
usd: 50
atomic: 50000000
- name: 6,000-credit pack
credits: 6000
usd: 100
atomic: 100000000
facilitator: https://api.cdp.coinbase.com/platform
docs: docs/x402.md