Skip to main content

Resolve

The resolve endpoint is the core of Model Graph. Given any model identifier string — from any SDK, platform, or provider — it finds the matching model and suggests an upgrade in the same format.

This powers tools like AI Updater Bot, which scans codebases for outdated model references and creates PRs with upgrades.

Resolve a model string​

GET /api/v1/resolve?q={detected_string}

Query Parameters​

ParameterTypeRequiredDescription
qstringYesThe model identifier string to resolve

How Matching Works​

The resolver tries to match the input string against all known aliases in three stages:

  1. Exact match (confidence: 1.0) — the string exactly matches a known alias
  2. Normalized match (confidence: 0.8) — the string matches after normalization (stripping version suffixes, provider prefixes, etc.)
  3. Substring match (confidence: 0.5) — the string is a substring of a known alias, or vice versa

Format-Preserving Replacement​

When a match is found and an upgrade is available, the resolver returns the upgrade model's alias with the same source as the matched alias. This means:

  • If you pass a Bedrock-format string, you get a Bedrock-format upgrade
  • If you pass a LiteLLM-format string, you get a LiteLLM-format upgrade
  • If you pass an official string, you get an official upgrade

This eliminates the need for any format conversion on the consumer's side.

Examples​

Official model ID​

curl "https://api.modelgraph.ai/api/v1/resolve?q=claude-3-sonnet-20240229"
{
"matched_model": {
"slug": "claude-3-sonnet-20240229",
"display_name": "Claude 3 Sonnet",
"status": "deprecated",
"family": "claude-sonnet"
},
"matched_alias": {
"alias": "claude-3-sonnet-20240229",
"source": "official"
},
"confidence": 1.0,
"is_latest": false,
"upgrade": {
"slug": "claude-sonnet-4-6",
"display_name": "Claude Sonnet 4.6",
"status": "latest"
},
"upgrade_alias": {
"alias": "claude-sonnet-4-6",
"source": "official"
}
}

AWS Bedrock format​

curl "https://api.modelgraph.ai/api/v1/resolve?q=anthropic.claude-3-5-sonnet-20241022-v2:0"
{
"matched_model": {
"slug": "claude-3-5-sonnet-20241022",
"display_name": "Claude 3.5 Sonnet",
"status": "active",
"family": "claude-sonnet"
},
"matched_alias": {
"alias": "anthropic.claude-3-5-sonnet-20241022-v2:0",
"source": "bedrock"
},
"confidence": 1.0,
"is_latest": false,
"upgrade": {
"slug": "claude-sonnet-4-6",
"display_name": "Claude Sonnet 4.6",
"status": "latest"
},
"upgrade_alias": {
"alias": "anthropic.claude-sonnet-4-6-v1:0",
"source": "bedrock"
}
}

LiteLLM format​

curl "https://api.modelgraph.ai/api/v1/resolve?q=anthropic/claude-3-5-sonnet-20241022"
{
"matched_model": {
"slug": "claude-3-5-sonnet-20241022",
"display_name": "Claude 3.5 Sonnet",
"status": "active",
"family": "claude-sonnet"
},
"matched_alias": {
"alias": "anthropic/claude-3-5-sonnet-20241022",
"source": "litellm"
},
"confidence": 1.0,
"is_latest": false,
"upgrade": {
"slug": "claude-sonnet-4-6",
"display_name": "Claude Sonnet 4.6",
"status": "latest"
},
"upgrade_alias": {
"alias": "anthropic/claude-sonnet-4-6",
"source": "litellm"
}
}

Already-latest model​

curl "https://api.modelgraph.ai/api/v1/resolve?q=claude-sonnet-4-6"
{
"matched_model": {
"slug": "claude-sonnet-4-6",
"display_name": "Claude Sonnet 4.6",
"status": "latest",
"family": "claude-sonnet"
},
"matched_alias": {
"alias": "claude-sonnet-4-6",
"source": "official"
},
"confidence": 1.0,
"is_latest": true,
"upgrade": null,
"upgrade_alias": null
}

Response Fields​

FieldTypeDescription
matched_modelobjectThe canonical model this string maps to
matched_model.slugstringModel slug
matched_model.display_namestringHuman-readable name
matched_model.statusstringactive, latest, deprecated, or sunset
matched_model.familystringFamily slug
matched_aliasobjectThe specific alias that matched
matched_alias.aliasstringThe exact alias string
matched_alias.sourcestringWhich SDK/platform uses this alias
confidencenumberMatch confidence: 1.0 exact, 0.8 normalized, 0.5 substring
is_latestbooleanWhether the matched model is already the latest in its family
upgradeobject | nullThe recommended replacement model (null if already latest)
upgrade_aliasobject | nullThe replacement string in the same format as the input

Errors​

StatusCodeDescription
400bad_requestMissing q parameter
404not_foundNo matching model found for the given string