Create a Retopology Session
Create a new retopology session by providing an input mesh and setting the desired parameters.
Request
POST https://api.csm.ai/v3/sessions
Parameters
type REQUIRED
type: string
in: body
description: Must be set to "retopology"
input REQUIRED
type: object
in: body
description: Input parameters for the retopology session
input.mesh REQUIRED
type: string
in: body
description: GLB URL or Cube asset ID of the input mesh to retopologize
input.model REQUIRED
type: string
in: body
default: "swift"
options: swift
or precision
description: The retopology model to use
Model Version Details:
swift
- Up to 8K faces
- ~5-10 minute runtime
- Lightweight & efficient topology
- Ideal for mobile games
precision
- High face count
- Up to 50 minute runtime
- Preserves fine details
- Clean edge flow (quad-friendly)
input.quads OPTIONAL
type: boolean
in: body
default: true
description: If true, convert triangles to quads where possible. The resulting mesh may have mixed topology.
Code Snippets
Python
import requests
import json
url = "https://api.csm.ai/v3/sessions"
payload = json.dumps({
"type": "retopology",
"input": {
"model": "swift",
"mesh": "https://your-mesh-url.com/mesh.glb", # or "ASSET_<ID>"
"quads": True
}
})
headers = {
'x-api-key': '<X-API_KEY>',
'Content-Type': 'application/json'
}
response = requests.post(url, headers=headers, data=payload)
print(response.text)
Node.js
var request = require('request');
var options = {
method: 'POST',
url: 'https://api.csm.ai/v3/sessions',
headers: {
'x-api-key': '<X-API_KEY>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
type: "retopology",
input: {
model: "swift",
mesh: "https://your-mesh-url.com/mesh.glb", // or "ASSET_<ID>"
quads: true
}
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
Curl
curl -X 'POST' \
'https://api.csm.ai/v3/sessions' \
-H 'accept: application/json' \
-H 'x-api-key: <X-API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"type": "retopology",
"input": {
"model": "swift",
"mesh": "https://your-mesh-url.com/mesh.glb", # or "ASSET_<ID>"
"quads": true
}
}'
Response
{
"_id": "SESSION_1747336753_6390509",
"user_id": "65dcb52836eacb7fb01df627",
"status": "incomplete",
"created_at": "2025-05-15T19:19:13.720Z",
"updated_at": "2025-05-15T19:19:13.720Z",
"type": "retopology",
"input": {
"mesh": {
"_id": "ASSET_1747335632_4906245",
"name": "input mesh name",
"status": "complete",
"data": {
"glb_url": "https://your-mesh-url.com/mesh.glb",
}
},
"model": "swift",
"quads": true
},
"output": {
"meshes": [
{
"_id": "ASSET_1747336753_4977382",
"name": "Red Cube model retopo 1",
"status": "incomplete",
"data": {
"obj_url": "",
"image_url": ""
}
}
// ... additional mesh variations
]
}
}