curl --request POST \
--url https://api.supermodeltools.com/v1/graphs/supermodel \
--header 'Content-Type: multipart/form-data' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-Api-Key: <api-key>' \
--form file='@example-file'{
"repo": "supermodel/supermodel-public-api",
"version": "sir-2025-02-05",
"schemaVersion": "1.2.0",
"generatedAt": "2025-02-05T15:42:10.000Z",
"summary": {
"repoSizeBytes": 123456,
"filesProcessed": 42,
"classes": 8,
"functions": 156,
"types": 12,
"primaryLanguage": "typescript",
"domains": 5
},
"graph": {
"nodes": [
{
"id": "src/index.ts",
"labels": [
"File"
],
"properties": {
"path": "src/index.ts",
"name": "index.ts",
"language": "typescript"
}
},
{
"id": "fn:src/index.ts:main",
"labels": [
"Function"
],
"properties": {
"name": "main",
"filePath": "src/index.ts",
"startLine": 10,
"endLine": 25
}
},
{
"id": "fn:src/utils.ts:helper",
"labels": [
"Function"
],
"properties": {
"name": "helper",
"filePath": "src/utils.ts"
}
},
{
"id": "domain:Core",
"labels": [
"Domain"
],
"properties": {
"name": "Core",
"description": "Core application logic"
}
},
{
"id": "subdomain:Core:Initialization",
"labels": [
"Subdomain"
],
"properties": {
"name": "Initialization",
"parentDomain": "Core"
}
}
],
"relationships": [
{
"id": "src/index.ts_contains_fn:src/index.ts:main",
"type": "contains",
"startNode": "src/index.ts",
"endNode": "fn:src/index.ts:main"
},
{
"id": "src/index.ts_imports_src/utils.ts",
"type": "imports",
"startNode": "src/index.ts",
"endNode": "src/utils.ts"
},
{
"id": "fn:src/index.ts:main_calls_fn:src/utils.ts:helper",
"type": "calls",
"startNode": "fn:src/index.ts:main",
"endNode": "fn:src/utils.ts:helper"
},
{
"id": "fn:src/index.ts:main_belongsTo_subdomain:Core:Initialization",
"type": "belongsTo",
"startNode": "fn:src/index.ts:main",
"endNode": "subdomain:Core:Initialization"
}
]
},
"artifacts": [
{
"id": "artifact-usage-summary",
"kind": "summary",
"label": "Usage Insights",
"metadata": {
"repoSizeBytes": 123456,
"filesProcessed": 42,
"functions": 156,
"classes": 8
}
},
{
"id": "parse-graph",
"kind": "graph",
"label": "Parse Graph",
"metadata": {
"nodeCount": 150,
"relationshipCount": 280
}
},
{
"id": "call-graph",
"kind": "graph",
"label": "Call Graph",
"metadata": {
"totalFunctions": 156,
"totalCalls": 423
}
},
{
"id": "domain-classification",
"kind": "classification",
"label": "Domain Classification",
"metadata": {
"domainCount": 5,
"relationshipCount": 8,
"fileAssignments": 42,
"functionAssignments": 120
}
}
]
}Upload a zipped repository snapshot to generate the Supermodel Intermediate Representation (SIR) artifact bundle.
curl --request POST \
--url https://api.supermodeltools.com/v1/graphs/supermodel \
--header 'Content-Type: multipart/form-data' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-Api-Key: <api-key>' \
--form file='@example-file'{
"repo": "supermodel/supermodel-public-api",
"version": "sir-2025-02-05",
"schemaVersion": "1.2.0",
"generatedAt": "2025-02-05T15:42:10.000Z",
"summary": {
"repoSizeBytes": 123456,
"filesProcessed": 42,
"classes": 8,
"functions": 156,
"types": 12,
"primaryLanguage": "typescript",
"domains": 5
},
"graph": {
"nodes": [
{
"id": "src/index.ts",
"labels": [
"File"
],
"properties": {
"path": "src/index.ts",
"name": "index.ts",
"language": "typescript"
}
},
{
"id": "fn:src/index.ts:main",
"labels": [
"Function"
],
"properties": {
"name": "main",
"filePath": "src/index.ts",
"startLine": 10,
"endLine": 25
}
},
{
"id": "fn:src/utils.ts:helper",
"labels": [
"Function"
],
"properties": {
"name": "helper",
"filePath": "src/utils.ts"
}
},
{
"id": "domain:Core",
"labels": [
"Domain"
],
"properties": {
"name": "Core",
"description": "Core application logic"
}
},
{
"id": "subdomain:Core:Initialization",
"labels": [
"Subdomain"
],
"properties": {
"name": "Initialization",
"parentDomain": "Core"
}
}
],
"relationships": [
{
"id": "src/index.ts_contains_fn:src/index.ts:main",
"type": "contains",
"startNode": "src/index.ts",
"endNode": "fn:src/index.ts:main"
},
{
"id": "src/index.ts_imports_src/utils.ts",
"type": "imports",
"startNode": "src/index.ts",
"endNode": "src/utils.ts"
},
{
"id": "fn:src/index.ts:main_calls_fn:src/utils.ts:helper",
"type": "calls",
"startNode": "fn:src/index.ts:main",
"endNode": "fn:src/utils.ts:helper"
},
{
"id": "fn:src/index.ts:main_belongsTo_subdomain:Core:Initialization",
"type": "belongsTo",
"startNode": "fn:src/index.ts:main",
"endNode": "subdomain:Core:Initialization"
}
]
},
"artifacts": [
{
"id": "artifact-usage-summary",
"kind": "summary",
"label": "Usage Insights",
"metadata": {
"repoSizeBytes": 123456,
"filesProcessed": 42,
"functions": 156,
"classes": 8
}
},
{
"id": "parse-graph",
"kind": "graph",
"label": "Parse Graph",
"metadata": {
"nodeCount": 150,
"relationshipCount": 280
}
},
{
"id": "call-graph",
"kind": "graph",
"label": "Call Graph",
"metadata": {
"totalFunctions": 156,
"totalCalls": 423
}
},
{
"id": "domain-classification",
"kind": "classification",
"label": "Domain Classification",
"metadata": {
"domainCount": 5,
"relationshipCount": 8,
"fileAssignments": 42,
"functionAssignments": 120
}
}
]
}API key issued by the control plane for accessing data plane resources.
Unique identifier for this request for idempotency and tracing.
Zipped repository archive containing the code to analyze.
Supermodel IR document
Repository slug the IR was generated from.
Version identifier for the IR content.
Version of the IR schema.
Timestamp when the IR was generated.
Unified code graph containing all nodes and relationships.
Show child attributes
High-level metadata and summary insights including filesProcessed, classes, functions, types, primaryLanguage, and domains count.
Per-source statistics and metadata for parse graph, call graph, and domain classification.
Show child attributes