Call this from your server: it takes your API key, and only the token goes to the browser. The token is valid for 5 minutes, so create one for each session, right before you open its WebSocket. The Trinity-2 fields, streaming_width, streaming_height, avatar_position_x, avatar_position_y, camera, background_id and foreground_id, are covered in Trinity-2. For the whole flow, see Custom JS Simli Client.
Width of the streamed video in pixels, Trinity-2 faces only (the others keep their own frame size). At least 512, and with streaming_height one of 1:1, 16:9 or 9:16, otherwise a 422. A canvas larger than the avatar's frame is padded with its background; a smaller one crops a window out of it.
The camera the session starts with, on top of the avatar's own framing. Trinity-2 only. Leave it out to keep the avatar's framing. A streaming session can move it afterwards with CAM_ messages.
One of your uploaded backgrounds, by the id POST /assets/backgrounds returned, to show behind the avatar, cropped to fill the canvas. Trinity-2 only. Leave it out for the avatar's own. An id that is not one of your account's is dropped with a warning, and the session uses the avatar's own. An image is not accepted: upload it first. A streaming session can change it afterwards with BG_ messages.
One of your uploaded foregrounds, by the id POST /assets/foregrounds returned, laid over the avatar through its transparency and cropped to fill the canvas. Trinity-2 only; otherwise as background_id. A streaming session can change it afterwards with FG_ messages.
Starting camera fields outside their supported range, region overrides, and background_id / foreground_id dropped as not your account's (the avatar's own is used). The token is minted regardless.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Simli","colors":{"primary":"#000000","light":"#FFFFFF","dark":"#000000"},"logo":{"light":"https://mintcdn.com/simli/e7vpJ8reuLmgco-7/logo/light.svg?fit=max\u0026auto=format\u0026n=e7vpJ8reuLmgco-7\u0026q=85\u0026s=ab224d08b203f5621799e376209ad32c","dark":"https://mintcdn.com/simli/e7vpJ8reuLmgco-7/logo/dark.svg?fit=max\u0026auto=format\u0026n=e7vpJ8reuLmgco-7\u0026q=85\u0026s=97b2a0b728cb8c7ad4d3f4a7cb41f746"},"favicon":"https://mintcdn.com/simli/e7vpJ8reuLmgco-7/favicon.svg?fit=max\u0026auto=format\u0026n=e7vpJ8reuLmgco-7\u0026q=85\u0026s=8496dd74f9a50da8131f9f4ddf4f77e9","appearance":{"default":"dark","strict":true},"navbar":{"links":[{"href":"https://discord.gg/yQx49zNF4d","label":"Need help, talk to us on Discord"}],"primary":{"type":"button","label":"Simli Dashboard","href":"https://app.simli.com/"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"simli","hasAudioNarration":false,"actualSubdomain":"simli","customDomains":["docs.simli.com"],"gitSource":{"type":"github","owner":"simliai","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae0951583d301a35cf4a230","collectionId":"cdc499ea-b231-4845-b548-0432efc4f64f","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae0951583d301a35cf4a230"},"feedback":{"edits":true},"entitlements":{},"buildId":"6ae0951583d301a35cf4a230","clientVersion":"0.0.4076","searchFilterCounts":[{"language":"default","tag":"REST API","count":34},{"language":"default","tag":"Endpoints","count":29},{"language":"default","tag":"API Reference","count":29},{"language":"default","tag":"Documentation","count":26},{"language":"default","tag":"Get Started","count":7},{"language":"default","tag":"Simli SDKs","count":7},{"language":"default","tag":"Advanced: Custom Simli Client","count":5},{"language":"default","tag":"Trinity-2","count":4},{"language":"default","tag":"JavaScript SDK","count":3},{"language":"default","tag":"Integrations","count":3}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"body{background-color:black}#search-bar-entry{display:none}#search-bar-entry-mobile{display:none}"}],"page":{"pagePath":"api-reference/endpoint/webrtc/startAudioToVideoSession","slug":"/api-reference/endpoint/webrtc/startAudioToVideoSession","pageMetadata":{"title":"/compose/token","description":"Create a session token for a streaming session","openapi":"POST /compose/token","href":"/api-reference/endpoint/webrtc/startAudioToVideoSession"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Create a session token for a streaming session\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,..._provideComponents(),...props.components};return _jsxs(_components.p,{children:[`Call this from your server: it takes your API key, and only the token goes to the browser. The token is valid for 5 minutes, so create one for each session, right before you open its WebSocket. The Trinity-2 fields, `,_jsx(_components.code,{children:`streaming_width`}),`, `,_jsx(_components.code,{children:`streaming_height`}),`, `,_jsx(_components.code,{children:`avatar_position_x`}),`, `,_jsx(_components.code,{children:`avatar_position_y`}),`, `,_jsx(_components.code,{children:`camera`}),`, `,_jsx(_components.code,{children:`background_id`}),` and `,_jsx(_components.code,{children:`foreground_id`}),`, are covered in `,_jsx(_components.a,{href:`/api-reference/trinity-2#framing-the-video`,children:`Trinity-2`}),`. For the whole flow, see `,_jsx(_components.a,{href:`/api-reference/simli-webrtc`,children:`Custom JS Simli Client`}),`.`]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"/compose/token","description":"Create a session token for a streaming session","openapi":"POST /compose/token","href":"/api-reference/endpoint/webrtc/startAudioToVideoSession"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"summary":"Compose Session Token","description":"Create a session token for a streaming session","operationId":"start_audio_to_video_session_compose_token_post","requestBody":"91a30490-6463-44f1-aa4c-238d41c09ccb","responses":{"200":"539893ab-2caa-4a77-a918-a855cae3e436","400":"a2c8ad9c-d68b-489b-8c09-36ec188e1f12","422":"69ee3ab0-8aaf-4acd-b92d-ca53c1ada0e5"},"method":"post","type":"path","servers":["b5c6865c-2f55-4d22-af87-26387dcbfe71"],"security":["e2d81f5c-00cd-4141-b803-23628fa52efb"],"path":"/compose/token","baseUrlOptions":["https://api.simli.ai/"],"title":"Compose Session Token","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"faceId":{"type":"string","title":"Faceid","isRequired":true,"uniqueKey":"faceId","typeLabel":"string"},"apiVersion":{"type":"string","title":"Apiversion","const":"v2","default":"v2","uniqueKey":"apiVersion","typeLabel":"string"},"sessionAggregator":{"oneOf":[{"type":"string","title":"Sessionaggregator","uniqueKey":"sessionAggregator.oneOf.0","typeLabel":"string"},{"type":"null","title":"Sessionaggregator","uniqueKey":"sessionAggregator.oneOf.1","typeLabel":"null"}],"uniqueKey":"sessionAggregator","typeLabel":"string | null"},"handleSilence":{"type":"boolean","title":"Handlesilence","default":true,"uniqueKey":"handleSilence","typeLabel":"boolean"},"maxSessionLength":{"type":"integer","title":"Maxsessionlength","default":3600,"uniqueKey":"maxSessionLength","typeLabel":"integer"},"maxIdleTime":{"type":"integer","title":"Maxidletime","default":300,"uniqueKey":"maxIdleTime","typeLabel":"integer"},"startFrame":{"type":"integer","title":"Startframe","default":0,"uniqueKey":"startFrame","typeLabel":"integer"},"audioInputFormat":{"type":"string","title":"Audioinputformat","default":"pcm16","uniqueKey":"audioInputFormat","typeLabel":"string"},"streaming_width":{"type":"integer","title":"Streaming Width","default":768,"minimum":512,"description":"Width of the streamed video in pixels, Trinity-2 faces only (the others keep their own frame size). At least 512, and with streaming_height one of 1:1, 16:9 or 9:16, otherwise a 422. A canvas larger than the avatar's frame is padded with its background; a smaller one crops a window out of it.","uniqueKey":"streaming_width","typeLabel":"integer"},"streaming_height":{"type":"integer","title":"Streaming Height","default":768,"minimum":512,"description":"Height of the streamed video in pixels. See streaming_width.","uniqueKey":"streaming_height","typeLabel":"integer"},"avatar_position_x":{"type":"number","title":"Avatar Position X","default":0.5,"minimum":0,"maximum":1,"description":"Where the avatar sits across the canvas, from 0 (left) to 1 (right). Trinity-2 only.","uniqueKey":"avatar_position_x","typeLabel":"number"},"avatar_position_y":{"type":"number","title":"Avatar Position Y","default":1,"minimum":0,"maximum":1,"description":"Where the avatar sits down the canvas, from 0 (top) to 1 (bottom). Trinity-2 only.","uniqueKey":"avatar_position_y","typeLabel":"number"},"camera":{"oneOf":[{"type":"object","title":"CameraSetting","description":"The camera the session starts with, on top of the avatar's own framing. Trinity-2 only. Leave it out to keep the avatar's framing. A streaming session can move it afterwards with CAM_ messages.","properties":{"pos_x_off":{"type":"number","default":0,"description":"Moves the avatar right, in half canvas widths. Supported range -10 to 10.","uniqueKey":"camera.oneOf.0.pos_x_off","typeLabel":"number"},"pos_y_off":{"type":"number","default":0,"description":"Moves the avatar down, in half canvas heights. Supported range -10 to 10.","uniqueKey":"camera.oneOf.0.pos_y_off","typeLabel":"number"},"pos_z_off":{"type":"number","default":0,"description":"Metres the camera backs away from the avatar (negative moves in). Supported range -5 to 5.","uniqueKey":"camera.oneOf.0.pos_z_off","typeLabel":"number"},"rot_x_off":{"type":"number","default":0,"description":"Degrees the camera tilts up (pitch). Supported range -180 to 180.","uniqueKey":"camera.oneOf.0.rot_x_off","typeLabel":"number"},"rot_y_off":{"type":"number","default":0,"description":"Degrees the camera pans right (yaw). Supported range -180 to 180.","uniqueKey":"camera.oneOf.0.rot_y_off","typeLabel":"number"},"rot_z_off":{"type":"number","default":0,"description":"Degrees the camera rolls clockwise. Supported range -180 to 180.","uniqueKey":"camera.oneOf.0.rot_z_off","typeLabel":"number"},"zoom":{"type":"number","default":1,"description":"Multiplies the avatar's zoom; 1 is no change. Supported range above 0, up to 4.","uniqueKey":"camera.oneOf.0.zoom","typeLabel":"number"},"orbit_x_off":{"type":"number","default":0,"description":"Degrees the camera orbits up over the avatar's head (elevation). Supported range -80 to 80.","uniqueKey":"camera.oneOf.0.orbit_x_off","typeLabel":"number"},"orbit_y_off":{"type":"number","default":0,"description":"Degrees the camera orbits round to its right (azimuth). Supported range -180 to 180.","uniqueKey":"camera.oneOf.0.orbit_y_off","typeLabel":"number"}},"uniqueKey":"camera.oneOf.0","typeLabel":"CameraSetting · object"},{"type":"null","description":"The camera the session starts with, on top of the avatar's own framing. Trinity-2 only. Leave it out to keep the avatar's framing. A streaming session can move it afterwards with CAM_ messages.","uniqueKey":"camera.oneOf.1","typeLabel":"null"}],"uniqueKey":"camera","typeLabel":"CameraSetting · object | null"},"background_id":{"oneOf":[{"type":"string","title":"Background Id","description":"One of your uploaded backgrounds, by the id POST /assets/backgrounds returned, to show behind the avatar, cropped to fill the canvas. Trinity-2 only. Leave it out for the avatar's own. An id that is not one of your account's is dropped with a warning, and the session uses the avatar's own. An image is not accepted: upload it first. A streaming session can change it afterwards with BG_ messages.","format":"uuid","uniqueKey":"background_id.oneOf.0","typeLabel":"string\u003cuuid>"},{"type":"null","title":"Background Id","description":"One of your uploaded backgrounds, by the id POST /assets/backgrounds returned, to show behind the avatar, cropped to fill the canvas. Trinity-2 only. Leave it out for the avatar's own. An id that is not one of your account's is dropped with a warning, and the session uses the avatar's own. An image is not accepted: upload it first. A streaming session can change it afterwards with BG_ messages.","uniqueKey":"background_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"background_id","typeLabel":"string\u003cuuid> | null"},"foreground_id":{"oneOf":[{"type":"string","title":"Foreground Id","description":"One of your uploaded foregrounds, by the id POST /assets/foregrounds returned, laid over the avatar through its transparency and cropped to fill the canvas. Trinity-2 only; otherwise as background_id. A streaming session can change it afterwards with FG_ messages.","format":"uuid","uniqueKey":"foreground_id.oneOf.0","typeLabel":"string\u003cuuid>"},{"type":"null","title":"Foreground Id","description":"One of your uploaded foregrounds, by the id POST /assets/foregrounds returned, laid over the avatar through its transparency and cropped to fill the canvas. Trinity-2 only; otherwise as background_id. A streaming session can change it afterwards with FG_ messages.","uniqueKey":"foreground_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"foreground_id","typeLabel":"string\u003cuuid> | null"}},"type":"object","required":["faceId"],"title":"StartStreamingSessionRequest","uniqueKey":"","typeLabel":"StartStreamingSessionRequest · object"},"examples":{"Example":{"title":"Example","value":{"faceId":"\u003cstring>","apiVersion":"v2","sessionAggregator":"\u003cstring>","handleSilence":true,"maxSessionLength":3600,"maxIdleTime":300,"startFrame":0,"audioInputFormat":"pcm16","streaming_width":768,"streaming_height":768,"avatar_position_x":0.5,"avatar_position_y":1,"camera":{"pos_x_off":0,"pos_y_off":0,"pos_z_off":0,"rot_x_off":0,"rot_y_off":0,"rot_z_off":0,"zoom":1,"orbit_x_off":0,"orbit_y_off":0},"background_id":"3c90c3cc-0d44-4b50-8888-8dd25736052a","foreground_id":"3c90c3cc-0d44-4b50-8888-8dd25736052a"}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"539893ab-2caa-4a77-a918-a855cae3e436":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","properties":{"session_token":{"type":"string","uniqueKey":"session_token","typeLabel":"string"},"warnings":{"type":"array","items":{"type":"string","uniqueKey":"warnings.items.[INDEX]","typeLabel":"string"},"description":"Starting camera fields outside their supported range, region overrides, and background_id / foreground_id dropped as not your account's (the avatar's own is used). The token is minted regardless.","uniqueKey":"warnings","typeLabel":"string[]"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"session_token":"\u003cstring>","warnings":["\u003cstring>"]}}},"exampleType":"generated"}},"exampleType":"generated"},"a2c8ad9c-d68b-489b-8c09-36ec188e1f12":{"description":"Invalid Data","content":{"application/json":{"schema":{"type":"object","properties":{"session_token":{"type":"string","description":"FAIL TOKEN","uniqueKey":"session_token","typeLabel":"string"},"detail":{"type":"string","description":"Fail Reason","uniqueKey":"detail","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"session_token":"\u003cstring>","detail":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"69ee3ab0-8aaf-4acd-b92d-ca53c1ada0e5":{"description":"Validation Error","content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"loc":{"items":{"oneOf":[{"type":"string","uniqueKey":"detail.items.[INDEX].loc.items.[INDEX].oneOf.0","typeLabel":"string"},{"type":"integer","uniqueKey":"detail.items.[INDEX].loc.items.[INDEX].oneOf.1","typeLabel":"integer"}],"uniqueKey":"detail.items.[INDEX].loc.items.[INDEX]","typeLabel":"string | integer"},"type":"array","title":"Location","isRequired":true,"uniqueKey":"detail.items.[INDEX].loc","typeLabel":"(string | integer)[]"},"msg":{"type":"string","title":"Message","isRequired":true,"uniqueKey":"detail.items.[INDEX].msg","typeLabel":"string"},"type":{"type":"string","title":"Error Type","isRequired":true,"uniqueKey":"detail.items.[INDEX].type","typeLabel":"string"},"input":{"oneOf":[{"title":"Input"}],"uniqueKey":"detail.items.[INDEX].input","typeLabel":"any"},"ctx":{"type":"object","title":"Context","uniqueKey":"detail.items.[INDEX].ctx","typeLabel":"Context · object"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError","uniqueKey":"detail.items.[INDEX]","typeLabel":"ValidationError · object"},"type":"array","title":"Detail","uniqueKey":"detail","typeLabel":"ValidationError · object[]"}},"type":"object","title":"HTTPValidationError","uniqueKey":"","typeLabel":"HTTPValidationError · object"},"examples":{"Example":{"title":"Example","value":{"detail":[{"loc":["\u003cstring>"],"msg":"\u003cstring>","type":"\u003cstring>","input":"\u003cunknown>","ctx":{}}]}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"e2d81f5c-00cd-4141-b803-23628fa52efb":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-simli-api-key","scopes":[],"schemeName":"ApiKeyAuth"}}},"servers":{"b5c6865c-2f55-4d22-af87-26387dcbfe71":{"url":"https://api.simli.ai/","description":"API server"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"x-simli-api-key","scopes":[],"schemeName":"ApiKeyAuth"},"schema":{"title":"x-simli-api-key","type":"string","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"ApiKeyAuth","name":"x-simli-api-key"}],"title":"ApiKeyAuth"}]},"originalFileLocation":"api-reference/openapi.yaml"},"subdomain":"simli","siteName":"Simli","title":"/compose/token - Simli","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-27T12:12:16.909Z","originalFileLocation":"api-reference/endpoint/webrtc/startAudioToVideoSession.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"dark\";if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Create a session token for a streaming session\">\u003cmeta data-mint-head name=\"application-name\" content=\"Simli\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/simli/dR1kVm9XH5IBTesa/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/simli/dR1kVm9XH5IBTesa/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/simli/dR1kVm9XH5IBTesa/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/simli/dR1kVm9XH5IBTesa/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/simli/dR1kVm9XH5IBTesa/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/simli/dR1kVm9XH5IBTesa/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/simli/dR1kVm9XH5IBTesa/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/simli/dR1kVm9XH5IBTesa/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/simli/dR1kVm9XH5IBTesa/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"/compose/token - Simli\">\u003cmeta data-mint-head property=\"og:description\" content=\"Create a session token for a streaming session\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Simli\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.simli.com/api-reference/endpoint/webrtc/startAudioToVideoSession\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://simli.mintlify.site/_mintlify/api/og/v2?division=Advanced%3A+Custom+Simli+Client\u0026amp;title=%2Fcompose%2Ftoken\u0026amp;description=Create+a+session+token+for+a+streaming+session\u0026amp;theme=34a365b37b524bfd386553d1\u0026amp;signature=b6a709073976ff9d57170e799d46a210c4f5ca9e2edd6f6fb4db9783ac9106e1\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"/compose/token - Simli\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Create a session token for a streaming session\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://simli.mintlify.site/_mintlify/api/og/v2?division=Advanced%3A+Custom+Simli+Client\u0026amp;title=%2Fcompose%2Ftoken\u0026amp;description=Create+a+session+token+for+a+streaming+session\u0026amp;theme=34a365b37b524bfd386553d1\u0026amp;signature=b6a709073976ff9d57170e799d46a210c4f5ca9e2edd6f6fb4db9783ac9106e1\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/simli/dR1kVm9XH5IBTesa/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Simli\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#000000\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.simli.com/api-reference/endpoint/webrtc/startAudioToVideoSession\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/endpoint/webrtc/startAudioToVideoSession.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.simli.com/#organization\",\"name\":\"Simli\",\"url\":\"https://docs.simli.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/simli/e7vpJ8reuLmgco-7/logo/light.svg?fit=max\u0026auto=format\u0026n=e7vpJ8reuLmgco-7\u0026q=85\u0026s=ab224d08b203f5621799e376209ad32c\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.simli.com#website\",\"name\":\"Simli\",\"url\":\"https://docs.simli.com\",\"publisher\":{\"@id\":\"https://docs.simli.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.simli.com/api-reference/endpoint/webrtc/startAudioToVideoSession#webpage\",\"url\":\"https://docs.simli.com/api-reference/endpoint/webrtc/startAudioToVideoSession\",\"name\":\"/compose/token\",\"description\":\"Create a session token for a streaming session\",\"dateModified\":\"2026-10-27T12:12:16.909Z\",\"isPartOf\":{\"@id\":\"https://docs.simli.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.simli.com/api-reference/endpoint/webrtc/startAudioToVideoSession#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.simli.com/api-reference/endpoint/webrtc/startAudioToVideoSession#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Advanced: Custom Simli Client\",\"item\":\"https://docs.simli.com/api-reference/simli-webrtc\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"/compose/token\",\"item\":\"https://docs.simli.com/api-reference/endpoint/webrtc/startAudioToVideoSession\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.simli.com/api-reference/endpoint/webrtc/startAudioToVideoSession#apireference\",\"headline\":\"/compose/token\",\"name\":\"/compose/token\",\"description\":\"Create a session token for a streaming session\",\"url\":\"https://docs.simli.com/api-reference/endpoint/webrtc/startAudioToVideoSession\",\"mainEntityOfPage\":{\"@id\":\"https://docs.simli.com/api-reference/endpoint/webrtc/startAudioToVideoSession#webpage\"},\"dateModified\":\"2026-10-27T12:12:16.909Z\",\"publisher\":{\"@id\":\"https://docs.simli.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.simli.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Simli\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Simli","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"group":"Get Started","pages":[{"title":"Welcome to Simli","icon":"door-open","href":"/overview"},{"title":"Create Avatar","icon":"person","href":"/api-reference/create-avatar"},{"group":"Trinity-2","icon":"star","pages":[{"title":"Trinity-2 Avatars","icon":"star","sidebarTitle":"Overview","href":"/api-reference/trinity-2"},{"title":"Camera","icon":"camera","href":"/api-reference/trinity-2/camera"},{"title":"Animations","icon":"hand","href":"/api-reference/trinity-2/animations"},{"title":"Backgrounds","icon":"image","href":"/api-reference/trinity-2/backgrounds"}]},{"title":"Default Faces","icon":"face-viewfinder","href":"/api-reference/preset-faces"}]},{"group":"Integrations","pages":[{"title":"LiveKit Agents","icon":"pickaxe","href":"/api-reference/livekit"},{"title":"Pipecat","icon":"cat","href":"/api-reference/pipecat"},{"title":"Trinity-2 in LiveKit Agents and Pipecat (temporary)","sidebarTitle":"Trinity-2 workarounds","href":"/api-reference/trinity-2/integration-workarounds"}]},{"group":"Simli SDKs","pages":[{"title":"Overview","icon":"gear-complex-code","iconType":"duotone","href":"/simli-sdks"},{"group":"JavaScript SDK","icon":"js","pages":[{"title":"JavaScript SDK","sidebarTitle":"Guide","href":"/api-reference/javascript"},{"title":"Trinity-2 in the JavaScript SDK","sidebarTitle":"Trinity-2","href":"/api-reference/javascript/trinity-2"},{"title":"JavaScript SDK reference","sidebarTitle":"API reference","href":"/api-reference/javascript/reference"}]},{"group":"Python SDK","icon":"python","pages":[{"title":"Python SDK","sidebarTitle":"Guide","href":"/api-reference/python"},{"title":"Trinity-2 in the Python SDK","sidebarTitle":"Trinity-2","href":"/api-reference/python/trinity-2"},{"title":"Python SDK reference","sidebarTitle":"API reference","href":"/api-reference/python/reference"}]}]},{"group":"Starter repos","icon":"github","pages":[{"title":"OpenAI Realtime","icon":"flower","href":"/api-reference/samples/openai"},{"title":"ElevenLabs","icon":"pause","href":"/api-reference/samples/elevenlabs"},{"title":"All Repos","icon":"grid","href":"/api-reference/samples/all-samples"}]},{"group":"Advanced: Custom Simli Client","pages":[{"title":"Custom JS Simli Client","href":"/api-reference/simli-webrtc"},{"group":"WebRTC Guides","icon":"book","pages":[{"title":"WebRTC","icon":"circle-info","href":"/api-reference/webrtc-info"},{"title":"Audio formats","icon":"circle-info","description":"Audio and the forgotten knowledge of the past","href":"/api-reference/audio-info"}]},{"title":"/compose/token","openapi":"POST /compose/token","href":"/api-reference/endpoint/webrtc/startAudioToVideoSession"},{"title":"/compose/ice","description":"Get temporary STUN and TURN servers for a peer-to-peer session","openapi":"GET /compose/ice","href":"/api-reference/endpoint/webrtc/getIceServers"}]},{"group":"Links","pages":[{"title":"Discord Server","icon":"discord","url":"https://discord.gg/yQx49zNF4d","href":"/api-reference/discord"}]}]},{"tab":"REST API","pages":[{"title":"REST API","href":"/api-reference/get-ice-servers"}]}]},"basePath":"","title":"/compose/token - Simli","buildId":"dpl_8LJbrAiZvr1K98WQNZXCyY5AvT34","deploymentId":"dpl_8LJbrAiZvr1K98WQNZXCyY5AvT34","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-i2a3QZ8E.js","utils-ChLwp8m0.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-DRktVTDc.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-CA2pEs4T.js","snippetPresets-ClQ6XrKD.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-Ct_Lv36y.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-Cn2PYw9e.js","shallow-rkyymjXQ.js","getApiPlaygroundDisplay-BB9vkXtE.js","CodeSnippet-Bm5RU7m1.js","CodeSnippets-BgU9Deuz.js","Page-BUDYNlhG.js","getPastedJson-BD-6NNum.js","icon-8Z6tud2e.js","MethodPill-Tuzr4g3V.js","DuplicateIcon-0ceWFYhN.js","createIcon-FBXow_ST.js","DynamicMarkdown-CD8713Yy.js","SectionHeading-7zgzQbH-.js","axios-vUo_bRtp.js","Markdown-D7Ofw1oz.js","clsx-eKJ4rcii.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-CwjSCXIK.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-9EK5IAXV.js"]}