Skip to content

Convert 3D models to GLB

By , Head of IntegrationsUpdated

Open this page in a new chat

Short answer

This page has 2 commands: Convert OBJ, USD, USDZ, FBX to GLB (POST /v2/files/3d/model2GLB) and Get results of GLB conversion job (GET /v2/files/3d/model2GLB). Use this method to convert OBJ, USD, USDZ, FBX to GLB format. Each call needs a bearer token and counts towards your hourly API limit.

After reading this you will know

  • How to convert 3D models to GLB
  • Which parameters each of the 2 commands takes
  • Sample code in 9 languages and a sample answer

Every command on this page needs a bearer token and counts towards your hourly limit.

POSThttps://api.sirv.com/v2/files/3d/model2GLB

Use this method to convert OBJ, USD, USDZ, FBX to GLB format.

The answer gives the ID of the job. Check its progress with Get results of GLB conversion job.

Request body (JSON)

FieldTypeRequiredExampleDescription
filenamestringYes/REST API Examples/model.usdzPath of the 3D model to convert: an OBJ, USD, USDZ or FBX file.

Example request

// Your bearer token, from POST /v2/token, in the SIRV_TOKEN environment variable
const res = await fetch('https://api.sirv.com/v2/files/3d/model2GLB', {
method: 'POST',
headers: { authorization: `Bearer ${process.env.SIRV_TOKEN}`, 'content-type': 'application/json' },
body: JSON.stringify({
"filename": "/REST API Examples/model.usdz"
}),
});
console.log(res.status, await res.text());

Example response

{
"id": "string"
}
GEThttps://api.sirv.com/v2/files/3d/model2GLB

Use this method to get results of the job created with POST /files/3d/model2GLB.

Query parameters

NameTypeRequiredExampleDescription
idstringYesJob ID returned from POST /files/3d/model2GLB

Example request

// Your bearer token, from POST /v2/token, in the SIRV_TOKEN environment variable
const res = await fetch('https://api.sirv.com/v2/files/3d/model2GLB?id=JOB_ID', {
method: 'GET',
headers: { authorization: `Bearer ${process.env.SIRV_TOKEN}` },
});
console.log(res.status, await res.text());

Example response

{
"progress": 0
}
Back to top