cURL
curl -X POST 'https://api.supermodeltools.com/v1/graphs/supermodel' \
-H 'Idempotency-Key: <idempotency-key>' \
-H 'X-Api-Key: <api-key>' \
-F 'file=@/path/to/your/repo-snapshot.zip;type=application/zip'{
"status": "completed",
"jobId": "abc-123-def",
"result": {
"repo": "supermodel/supermodel-public-api",
"version": "sir-2025-02-05",
"schemaVersion": "1.2.0",
"generatedAt": "2025-02-05 15:42:10.000000000 Z",
"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"
}
]
},
"stats": {
"nodeCount": 5,
"relationshipCount": 4,
"nodeTypes": {
"File": 1,
"Function": 2,
"Domain": 1,
"Subdomain": 1
},
"relationshipTypes": {
"contains": 1,
"imports": 1,
"calls": 1,
"belongsTo": 1
}
},
"metadata": {
"analysisStartTime": "2025-02-05T15:42:05Z",
"analysisEndTime": "2025-02-05T15:42:10Z",
"fileCount": 2,
"languages": [
"typescript"
]
},
"domains": [
{
"name": "Core",
"descriptionSummary": "Core application logic",
"keyFiles": [
"src/index.ts"
],
"responsibilities": [
"Application initialization"
],
"subdomains": [
{
"name": "Initialization",
"descriptionSummary": "Application startup logic",
"files": [
"src/index.ts"
],
"functions": [
"fn:src/index.ts:main"
],
"classes": []
}
]
}
],
"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
}
}
]
}
}Data Plane
Supermodel graph
Upload a zipped repository snapshot to generate the Supermodel Intermediate Representation (SIR) artifact bundle.
POST
/
v1
/
graphs
/
supermodel
cURL
curl -X POST 'https://api.supermodeltools.com/v1/graphs/supermodel' \
-H 'Idempotency-Key: <idempotency-key>' \
-H 'X-Api-Key: <api-key>' \
-F 'file=@/path/to/your/repo-snapshot.zip;type=application/zip'{
"status": "completed",
"jobId": "abc-123-def",
"result": {
"repo": "supermodel/supermodel-public-api",
"version": "sir-2025-02-05",
"schemaVersion": "1.2.0",
"generatedAt": "2025-02-05 15:42:10.000000000 Z",
"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"
}
]
},
"stats": {
"nodeCount": 5,
"relationshipCount": 4,
"nodeTypes": {
"File": 1,
"Function": 2,
"Domain": 1,
"Subdomain": 1
},
"relationshipTypes": {
"contains": 1,
"imports": 1,
"calls": 1,
"belongsTo": 1
}
},
"metadata": {
"analysisStartTime": "2025-02-05T15:42:05Z",
"analysisEndTime": "2025-02-05T15:42:10Z",
"fileCount": 2,
"languages": [
"typescript"
]
},
"domains": [
{
"name": "Core",
"descriptionSummary": "Core application logic",
"keyFiles": [
"src/index.ts"
],
"responsibilities": [
"Application initialization"
],
"subdomains": [
{
"name": "Initialization",
"descriptionSummary": "Application startup logic",
"files": [
"src/index.ts"
],
"functions": [
"fn:src/index.ts:main"
],
"classes": []
}
]
}
],
"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
}
}
]
}
}Authorizations
API key issued by the control plane for accessing data plane resources.
Headers
Unique identifier for this request for idempotency and tracing.
Body
multipart/form-data
Zipped repository archive containing the code to analyze.
Response
Supermodel IR document (job completed)
Async response envelope for Supermodel IR operations.
Current status of the job.
Available options:
pending, processing, completed, failed Unique identifier for the job.
Recommended seconds to wait before polling again.
Error message (present when status is failed).
The result (present when status is completed).
Show child attributes
Show child attributes
⌘I