API

NEMESIS API

Start checks from scripts and CI, follow them and read the results

Quick start

  1. Create a key on the API keys page.
  2. Start a check. The response comes back at once with its ID.
  3. Poll the check every 10–30 seconds until it finishes, or stream its progress.

Authentication

Send the key in the Authorization header. Each key has permissions; a request outside them gets 403.

HTTP
Authorization: Bearer nmk_8kQ2xV1pZr0a_…

Keys cannot create keys or change the account. Those actions need a signed-in browser.

Start a check

Give the reference as reference_endpoint, reference_api_key and reference_model, or name a key saved in your account with reference_saved_key. The second needs the provider-keys:use permission.

curl
curl -X POST https://isthismodel.com/api/v1/checks \
  -H "Authorization: Bearer $NEMESIS_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: build-1842" \
  -d '{
    "endpoint": "https://api.provider.example/v1",
    "api_key": "sk-…",
    "model": "claude-opus-4-8",
    "reference_saved_key": "openrouter",
    "reference_model": "anthropic/claude-opus-4.8",
    "tier": "base",
    "visibility": "private"
  }'

Provider keys you send are encrypted for the worker, held only while the check runs, then deleted. They never reach the database and are never returned.

Follow it

status goes queued → running → complete, or ends as failed or cancelled. result is there exactly when status is complete, and null in every other state. A failed check says why in failure.

Live progress

A Server-Sent Events stream. Frames already sent are replayed first. The stream ends after the final frame.

curl
curl -N https://isthismodel.com/api/v1/checks/$ID/events \
  -H "Authorization: Bearer $NEMESIS_KEY"

: connected
data: {"seq": 1, "type": "stage.enter", "stage": "preflight", "message": "…"}
data: {"seq": 2, "type": "probe.start", "stage": "probing", "message": "…"}
…
data: {"seq": 88, "type": "run.complete", "stage": "complete", "message": "…"}

Safe retries

Send an Idempotency-Key header when starting a check. A retry with the same key and body returns the first check instead of starting another, for 24 hours.

Gate a build on the result

A check ends as complete, failed or cancelled, and only a complete one is a result about the provider. Pass the build only when all of this holds:

  1. status is complete. A failed check is not a pass and not a finding: failure.code says why, and failure.retryable says whether starting it again can help.
  2. result.trust is not null.
  3. result.measurement_incomplete is false. Otherwise the score rests on a thin base: read this before the score.
  4. The lower end of result.trust_ci is at or above your bar. Use the lower end, not trust: it already allows for noise.
  5. No signal in result.signals has grade proven and a penalty above 0. A proven finding is a contradiction, not a low number, and no score makes up for it.
curl
# exit 0 = pass, 1 = the provider fell below the bar, 2 = no usable result
check=$(curl -sf "$NEMESIS/api/v1/checks/$ID" -H "Authorization: Bearer $NEMESIS_KEY")

echo "$check" | jq -e '.status == "complete"
  and .result.trust != null
  and (.result.measurement_incomplete | not)' > /dev/null || exit 2

echo "$check" | jq -e --argjson min 70 '
  .result.trust_ci[0] >= $min
  and ([.result.signals[] | select(.grade == "proven" and .penalty > 0)] | length == 0)
' > /dev/null

The score moves when the formula changes. Note formula_version when you pick the bar, and look at it again when that value changes: the same provider can score differently under a new formula.

A check that did not finish

result is null and failure is set. error is diagnostic text for a person; do not parse it. The codes:

JSON
{
  "id": "6f0c…",
  "status": "failed",
  "error": "provider is out of credit: ProviderError: HTTP 402 …",
  "failure": { "code": "provider_out_of_credit", "retryable": false },
  "result": null
}
failure.coderetry may helpwhen
provider_key_rejectednoA provider refused the key it was given (HTTP 401 or 403).
provider_out_of_creditnoA provider reported that the account behind the key has no credit left (HTTP 402).
provider_rate_limitedyesA provider rate-limited the check while it was running (HTTP 429).
provider_model_not_foundnoA provider answered that it does not serve the model (HTTP 404).
provider_unavailableyesA provider stopped answering, timed out or returned a server error.
reference_model_not_foundnoThe reference does not serve the model under that name or any normalised equivalent, so there was nothing to compare against. Name the reference model explicitly.
reference_spend_guardnoThe reference key's own spending limit could not be confirmed, or too little of it was left for a check.
key_expiredyesA submitted key was no longer held when the check started, so it could not run. Keys are kept only while a check waits and runs; start the check again.
reference_unavailablenoThe check had no usable reference: it was queued for the retired house reference, or no reference address was recorded.
internal_erroryesThe check failed inside NEMESIS. Starting it again may work; if it does not, report the check id.
unclassifiednoThe check failed before reasons were recorded as codes. The diagnostic text in `error` is all there is.

Errors

Every /api/ route answers errors in one shape. Branch on code; message is for people and is English. A 429 carries Retry-After in seconds.

HTTP
HTTP/1.1 429 Too Many Requests
Retry-After: 2400
X-Request-Id: 4f1c…

{
  "error": {
    "code": "quota_exceeded",
    "message": "base runs are limited to 10 per hour. …",
    "request_id": "4f1c…"
  }
}

The table is the list the server itself answers with. New codes may be added; treat one you do not know by its HTTP status.

HTTPcoderetry may helpwhen
400bad_requestnoThe request could not be understood.
400expirednoThe key has expired.
400invalid_cursornoThe pagination cursor is not valid.
400invalid_requestnoThe request was refused for a reason given in `message`.
400invalid_urlnoThe URL is not an address a provider can have.
400key_rejectednoThe provider refused the key.
400limit_not_confirmednoThe provider cannot show the key's spending limit, so it cannot be confirmed.
400low_remainingnoToo little is left on the key's limit for a check.
400management_keynoThe key is a management key, which cannot run models.
400no_balancenoThe provider account has no balance.
400no_limitnoThe key has no credit limit.
400no_saved_keynoNo key is saved for that provider.
400provider_rejectednoA provider refused the key, the model or the request when tested before the check.
400reference_expirednoFor the reference key: the key has expired.
400reference_key_rejectednoFor the reference key: the provider refused the key.
400reference_low_remainingnoFor the reference key: too little is left on the key's limit for a check.
400reference_management_keynoFor the reference key: the key is a management key, which cannot run models.
400reference_no_limitnoFor the reference key: the key has no credit limit.
400reference_wrong_providernoFor the reference key: the key does not look like it belongs to that provider.
400unknown_integrationnoThere is no such provider integration.
400wrong_providernoThe key does not look like it belongs to that provider.
401api_key_expirednoThe API key has passed its expiry.
401api_key_revokednoThe API key was revoked.
401invalid_api_keynoThe API key does not exist or is malformed.
401invalid_authorizationnoThe Authorization header is not `Bearer <api key>`.
401invalid_credentialsnoThe email or password is wrong.
401unauthenticatednoNo credentials were sent, or the session has ended.
403account_disablednoThe account is disabled.
403cross_site_requestnoA write from a browser session must come from our own pages.
403forbiddennoThe caller may not do this.
403insufficient_scopenoThe API key lacks a scope the endpoint needs.
403registration_closednoSign-up is closed.
403session_requirednoThe action is only available from a signed-in browser, not with an API key.
404not_foundnoThere is nothing at that id or address, or the caller may not see it.
405method_not_allowednoThe endpoint does not take that HTTP method.
409check_finishednoThe check is already over.
409check_runningnoThe check has started and can no longer be cancelled.
409conflictyesThe change collided with another one; reload and retry.
409email_takennoAn account with this email already exists.
409idempotency_in_progressyesA request with the same Idempotency-Key is still being processed.
409key_limit_reachednoThe account holds as many API keys as it may.
409key_unreadablenoThe saved key can no longer be opened; save it again.
422idempotency_key_reusednoThe Idempotency-Key was already used with a different body.
422invalid_emailnoThe email address is not valid.
422key_whitespacenoThe key contains whitespace.
422validation_errornoA field failed validation. `details` lists them, without the values sent.
422weak_passwordnoThe password does not meet the rules.
429budget_pausedyesChecks are paused until the service-wide daily budget resets at 00:00 UTC. `Retry-After` says when.
429quota_exceededyesThe run quota for this caller and tier is used up. `Retry-After` says when a unit frees.
429rate_limitedyesToo many requests in the current window. `Retry-After` says how long to wait.
500internal_erroryesSomething failed on our side. Quote the request id.
502provider_unreachableyesA provider could not be reached when tested before the check.
502reference_provider_unreachableyesThe reference provider did not say how much its key may spend.
502upstream_erroryesA service we depend on answered badly.
503queue_fullyesToo many checks are waiting for a worker. `Retry-After` says when to try again; nothing was started or counted against your limits.
503unavailableyesThe service is not available right now.

Limits

Up to 120 requests a minute per key, reported in the RateLimit-* headers. Starting a check also uses the account limit: 10 standard checks an hour and 3 deep checks a day. GET /api/v1/usage shows what is left.

Versioning

Everything is under /api/v1. Within v1 fields and endpoints are only added, never renamed or removed. A breaking change would ship as /api/v2 alongside it.

Not in the API

No webhooks: poll or stream instead. No listing or search of providers: lookup takes an exact address, as on the site.

Endpoints

Account

  • GET/api/v1/auth/scopesList the scopes an API key can holdno key needed
  • POST/api/v1/auth/registerCreate an account and sign inno key needed
  • POST/api/v1/auth/loginSign inno key needed
  • POST/api/v1/auth/logoutSign out this browserno key needed
  • GET/api/v1/auth/sessionWhether this browser is signed inno key needed
  • GET/api/v1/accountThe account making this request
  • DELETE/api/v1/accountDelete the accountbrowser session only
  • POST/api/v1/account/passwordChange the passwordbrowser session only
  • GET/api/v1/account/sessionsBrowsers signed in to this accountbrowser session only
  • DELETE/api/v1/account/sessions/{session_id}Sign out one browserbrowser session only
  • POST/api/v1/account/sessions/revoke-othersSign out every other browserbrowser session only
  • GET/api/v1/usageRun quota and request allowance left

API keys

  • GET/api/v1/keysList this account's API keysbrowser session only
  • POST/api/v1/keysCreate an API keybrowser session only
  • DELETE/api/v1/keys/{key_id}Revoke an API keybrowser session only

Depths and models

  • GET/api/v1/integrationsReference APIs a key can be saved forno key needed
  • GET/api/v1/catalog/openrouterOpenRouter models a reference can beno key needed
  • GET/api/v1/provider-keysProvider keys saved in this accountbrowser session only
  • PUT/api/v1/provider-keys/{provider}Save or replace the key for one integrationbrowser session only
  • DELETE/api/v1/provider-keys/{provider}Delete a saved provider keybrowser session only
  • POST/api/v1/provider-keys/{provider}/refreshAsk the provider for the key's current limitbrowser session only
  • GET/api/v1/provider-keys/{provider}/modelsModels the saved key can reachbrowser session only
  • GET/api/v1/tiersWhat each depth tier costsno key needed
  • GET/api/v1/errorsEvery error code and failure codeno key needed

Checks

  • GET/api/v1/checksList this account's checkschecks:read
  • POST/api/v1/checksStart a checkchecks:write
  • GET/api/v1/checks/{check_id}Get a check and its resultchecks:read
  • GET/api/v1/checks/{check_id}/eventsStream a check's progress (Server-Sent Events)checks:read
  • POST/api/v1/checks/{check_id}/cancelCancel a queued checkchecks:write
  • POST/api/v1/preflightTest provider connections without starting a checkchecks:write

Providers

  • POST/api/v1/providers/lookupThe public record for an exact provider URLproviders:read