Links

Examples

Examples of requests for rendering 2D avatars.
In these examples, replace the example URL with a valid 3D Avatar URL.

Simplest Request

{
"model": "https://example.com/model.glb",
"scene": "halfbody-portrait-v1"
}

Portrait from half-body avatar

The following request renders a smiling avatar portrait similar to the one shown below from a half-body avatar.
{
"model": "https://example.com/model.glb",
"scene": "halfbody-portrait-v1",
"armature": "ArmatureTargetFemale",
"blendShapes": {
"Wolf3D_Head": {
"mouthSmile": 0.2
}
}
}

Profile picture from full-body avatar

The following request renders a smiling portrait similar to the one shown below in a male pose from a full-body avatar.
{
"model": "https://example.com/model.glb",
"scene": "fullbody-portrait-v1",
"armature": "ArmatureTargetMale",
"blendShapes": {
"Wolf3D_Head": {
"mouthSmile": 0.2
}
}
}

JavaScript example complete code

<!doctype html>
<html>
<head>
<meta charset="UTF-8"/>
</head>
<body>
<button onclick="return render()">Render</button>
</body>
<script>
function render()
{
const params =
{
model: "https://example.com/model.glb",
scene: "fullbody-portrait-v1",
armature: "ArmatureTargetMale",
blendShapes: {}
}
const http = new XMLHttpRequest()
http.open("POST", "https://render.readyplayer.me/render")
http.setRequestHeader("Content-type", "application/json")
http.send(JSON.stringify(params))
http.onload = function()
{
// Do whatever with response
alert(http.responseText)
}
}
</script>
</html>

Python example complete code

import requests
if __name__ == "__main__":
r = requests.post(
"https://render.readyplayer.me/render",
json={
"model": "https://example.com/model.glb",
"scene": "fullbody-portrait-v1",
"armature": "ArmatureTargetMale",
"blendShapes": {}
},
headers={
"Content-Type": "application/json",
}
)
print(r.content)