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"
}
]
},
"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 -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"
}
]
},
"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 (job completed)
Async response envelope for Supermodel IR operations.
Current status of the job.
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