[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-runway-rw-integrate-characters":3,"mdc--huvukv-key":35,"related-repo-runway-rw-integrate-characters":7027,"related-org-runway-rw-integrate-characters":7119},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":12,"stars":24,"repoUrl":25,"updatedAt":26,"license":27,"forks":28,"topics":29,"repo":30,"sourceUrl":33,"mdContent":34},"rw-integrate-characters","integrate Runway conversational characters","Help users create Runway Characters (GWM-1 avatars) and integrate real-time conversational sessions into their apps",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},"runway","Runway","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Frunway.png","runwayml",[13,17,18,21],{"name":14,"slug":15,"type":16},"Creative","creative","tag",{"name":9,"slug":8,"type":16},{"name":19,"slug":20,"type":16},"Audio","audio",{"name":22,"slug":23,"type":16},"API Development","api-development",57,"https:\u002F\u002Fgithub.com\u002Frunwayml\u002Fskills","2026-04-08T04:42:06.171483",null,15,[],{"repoUrl":25,"stars":24,"forks":28,"topics":31,"description":32},[],"for Runway coding agent skills","https:\u002F\u002Fgithub.com\u002Frunwayml\u002Fskills\u002Ftree\u002FHEAD\u002Fskills\u002Frw-integrate-characters","---\nname: rw-integrate-characters\ndescription: \"Help users create Runway Characters (GWM-1 avatars) and integrate real-time conversational sessions into their apps\"\nuser-invocable: false\nallowed-tools: Read, Grep, Glob, Edit, Write\n---\n\n# Integrate Characters (GWM-1 Avatars)\n\n> **PREREQUISITES:**\n> - `+rw-check-compatibility` — Project must have a server-side component (API key must NEVER be exposed to the client)\n> - `+rw-fetch-api-reference` — Load the latest API reference from https:\u002F\u002Fdocs.dev.runwayml.com\u002Fapi\u002F before integrating\n> - `+rw-setup-api-key` — API credentials must be configured\n>\n> **OPTIONAL DEPENDENCIES:**\n> - `+rw-integrate-documents` — Add a knowledge base to your character\n> - `+rw-integrate-character-embed` — Use the React SDK to embed the avatar call UI\n\nHelp users create Runway Characters — real-time conversational AI avatars powered by GWM-1.\n\nUse this only when modifying a user's codebase. For direct avatar management or other one-off Runway account actions from the agent, use `+use-runway-api` instead.\n\nCharacters are generated from a **single image** (any visual style — photorealistic, animated, non-human) with full control over voice, personality, knowledge, and actions. No fine-tuning or training required.\n\n## Key Concepts\n\n### Avatars vs Sessions\n\n| Concept | Description |\n|---------|-------------|\n| **Avatar** | A persistent persona with a defined appearance, voice, and personality. Created once, used many times. |\n| **Session** | A live WebRTC connection for real-time conversation. Connects one user to one avatar. **Max duration: 5 minutes.** |\n\n### Session Lifecycle\n\n```\n                    ┌───────────┐\n         ┌──────────┤ NOT_READY ├──────────┐\n         │          └─────┬─────┘          │\n         │                │                │\n         ▼                ▼                ▼\n     CANCELLED          READY           FAILED\n                       ┌──┴──┐\n                       │     │\n                       ▼     ▼\n                    RUNNING FAILED\n                    ┌──┴──┐\n                    │     │\n                    ▼     ▼\n                COMPLETED CANCELLED\n```\n\n| Status | Description |\n|--------|-------------|\n| `NOT_READY` | Session is being provisioned. Poll until ready. |\n| `READY` | Session is ready. The `sessionKey` is available. |\n| `RUNNING` | WebRTC connection is active. Conversation in progress. |\n| `COMPLETED` | Session ended normally. |\n| `FAILED` | Error occurred. Check the `failure` field. |\n| `CANCELLED` | Explicitly cancelled before completion. |\n\n> **Important:** Session credentials can only be consumed **once**. If the WebRTC connection fails after credentials are consumed, you must create a new Session.\n\n### Architecture\n\nThe API key must stay server-side. The flow is:\n\n```\nClient (React)  →  Your Server  →  Runway API\n                                      ↓\nClient (React)  ←─── WebRTC ───← Runway (realtime)\n```\n\n1. Client requests a session from **your** server\n2. Your server calls Runway API to create a session (`POST \u002Fv1\u002Frealtime_sessions`)\n3. Your server polls until session is `READY` (`GET \u002Fv1\u002Frealtime_sessions\u002F:id`)\n4. Your server consumes credentials (`POST \u002Fv1\u002Frealtime_sessions\u002F:id\u002Fconsume`)\n5. Your server returns credentials to the client\n6. Client establishes a direct WebRTC connection to Runway\n\n## Step 1: Install Dependencies\n\n```bash\nnpm install @runwayml\u002Fsdk @runwayml\u002Favatars-react\n```\n\n- `@runwayml\u002Fsdk` — Server-side SDK (session creation, avatar management)\n- `@runwayml\u002Favatars-react` — Client-side React components (WebRTC, UI)\n\n## Step 2: Create an Avatar\n\nAvatars can be created via the **Developer Portal** (UI) or the **API** (programmatic).\n\n### Option A: Developer Portal (Recommended for first time)\n\n1. Go to **https:\u002F\u002Fdev.runwayml.com\u002F** → **Characters** tab\n2. Click **Create a Character**\n3. Upload a reference image (tips below)\n4. Choose a voice preset\n5. Write personality instructions (e.g., \"You are a helpful customer support agent for Acme Corp...\")\n6. Optionally add a starting script (what the character says first)\n7. Optionally upload knowledge documents (`.txt` files)\n8. Click **Create Character**\n9. Copy the **Avatar ID** (a UUID like `8be4df61-93ca-11d2-aa0d-00e098032b8c`)\n\n### Option B: API (Programmatic)\n\n```javascript\n\u002F\u002F Node.js\nimport RunwayML from '@runwayml\u002Fsdk';\n\nconst client = new RunwayML();\n\nconst avatar = await client.avatars.create({\n  name: 'Support Agent',\n  referenceImage: 'https:\u002F\u002Fexample.com\u002Favatar.png',\n  voice: {\n    type: 'runway-live-preset',\n    presetId: 'clara',\n  },\n  personality: 'You are a helpful customer support agent for Acme Corp. You help users with billing questions and technical issues.',\n});\n\nconsole.log('Avatar ID:', avatar.id);\n```\n\n```python\n# Python\nfrom runwayml import RunwayML\n\nclient = RunwayML()\n\navatar = client.avatars.create(\n    name='Support Agent',\n    reference_image='https:\u002F\u002Fexample.com\u002Favatar.png',\n    voice={\n        'type': 'runway-live-preset',\n        'preset_id': 'clara',\n    },\n    personality='You are a helpful customer support agent for Acme Corp.',\n)\n\nprint('Avatar ID:', avatar.id)\n```\n\n**If the reference image is a local file**, upload it first using `+rw-integrate-uploads`:\n\n```javascript\nimport fs from 'fs';\n\nconst upload = await client.uploads.createEphemeral(\n  fs.createReadStream('\u002Fpath\u002Fto\u002Favatar-image.png')\n);\n\nconst avatar = await client.avatars.create({\n  name: 'Support Agent',\n  referenceImage: upload.runwayUri,\n  voice: { type: 'runway-live-preset', presetId: 'clara' },\n  personality: 'You are a helpful customer support agent...',\n});\n```\n\n### Reference Image (Required)\n\n`referenceImage` is **required** when creating an avatar. It accepts three formats:\n\n| Format | Limit | When to use |\n|--------|-------|-------------|\n| `https:\u002F\u002F…` URL | 2048 chars | Image already hosted publicly |\n| `data:image\u002F…;base64,…` | 5 MB (characters) | Small-to-medium local files (~3.5 MB raw max) |\n| `runway:\u002F\u002F…` URI | 5000 chars | Large files uploaded via `\u002Fv1\u002Fuploads` first |\n\n\u003C\u003C\u003C\u003C\u003C\u003C\u003C HEAD:skills\u002Frw-integrate-characters\u002FSKILL.md\nFor local files over ~3.5 MB, use the upload flow (`+rw-integrate-uploads`) to get a `runway:\u002F\u002F` URI instead of a data URI.\n=======\nFor local files over ~3.5 MB, use the upload flow (`+integrate-uploads`) to get a `runway:\u002F\u002F` URI instead of a data URI.\n>>>>>>> 810dd3a (Improve CLI error details, auth fallback, and skill docs from testing):skills\u002Fintegrate-characters\u002FSKILL.md\n\n### Reference Image Guidelines\n\n- **Any visual style works**: photorealistic humans, animated mascots, stylized brand characters\n- Use high-quality images with good lighting\n- **Face must be clearly visible and centered** — images without a recognizable face will fail processing\n- Avoid images with multiple people or obstructions\n- Recommended aspect ratio: **1088×704**\n\n### Voice Presets\n\n| Preset ID | Name | Style |\n|-----------|------|-------|\n| `clara` | Clara | Soft, approachable |\n| `victoria` | Victoria | Firm, professional |\n| `vincent` | Vincent | Knowledgeable, authoritative |\n\nPreview all voices in the [Developer Portal](https:\u002F\u002Fdev.runwayml.com\u002F).\n\n## Step 3: Create a Session (Server-Side)\n\nThis is the **server-side API route** that your client will call. It creates a session, polls until ready, consumes credentials, and returns them.\n\n### Next.js App Router\n\n```typescript\n\u002F\u002F app\u002Fapi\u002Favatar\u002Fsession\u002Froute.ts\nimport RunwayML from '@runwayml\u002Fsdk';\n\nconst client = new RunwayML();\n\nexport async function POST(request: Request) {\n  const { avatarId } = await request.json();\n\n  \u002F\u002F 1. Create session\n  const { id: sessionId } = await client.realtimeSessions.create({\n    model: 'gwm1_avatars',\n    avatar: { type: 'custom', avatarId },\n  });\n\n  \u002F\u002F 2. Poll until ready\n  let sessionKey: string | undefined;\n  for (let i = 0; i \u003C 60; i++) {\n    const session = await client.realtimeSessions.retrieve(sessionId);\n\n    if (session.status === 'READY') {\n      sessionKey = session.sessionKey;\n      break;\n    }\n    if (session.status === 'FAILED') {\n      return Response.json({ error: session.failure }, { status: 500 });\n    }\n\n    await new Promise(r => setTimeout(r, 1000));\n  }\n\n  if (!sessionKey) {\n    return Response.json({ error: 'Session timed out' }, { status: 504 });\n  }\n\n  \u002F\u002F 3. Consume session to get WebRTC credentials\n  const consumeResponse = await fetch(\n    `${client.baseURL}\u002Fv1\u002Frealtime_sessions\u002F${sessionId}\u002Fconsume`,\n    {\n      method: 'POST',\n      headers: {\n        Authorization: `Bearer ${sessionKey}`,\n        'X-Runway-Version': '2024-11-06',\n      },\n    }\n  );\n  const credentials = await consumeResponse.json();\n\n  return Response.json({\n    sessionId,\n    serverUrl: credentials.url,\n    token: credentials.token,\n    roomName: credentials.roomName,\n  });\n}\n```\n\n### Express.js\n\n```typescript\nimport RunwayML from '@runwayml\u002Fsdk';\nimport express from 'express';\n\nconst client = new RunwayML();\nconst app = express();\napp.use(express.json());\n\napp.post('\u002Fapi\u002Favatar\u002Fsession', async (req, res) => {\n  const { avatarId } = req.body;\n\n  try {\n    \u002F\u002F 1. Create session\n    const { id: sessionId } = await client.realtimeSessions.create({\n      model: 'gwm1_avatars',\n      avatar: { type: 'custom', avatarId },\n    });\n\n    \u002F\u002F 2. Poll until ready\n    let sessionKey: string | undefined;\n    for (let i = 0; i \u003C 60; i++) {\n      const session = await client.realtimeSessions.retrieve(sessionId);\n\n      if (session.status === 'READY') {\n        sessionKey = session.sessionKey;\n        break;\n      }\n      if (session.status === 'FAILED') {\n        return res.status(500).json({ error: session.failure });\n      }\n\n      await new Promise(r => setTimeout(r, 1000));\n    }\n\n    if (!sessionKey) {\n      return res.status(504).json({ error: 'Session timed out' });\n    }\n\n    \u002F\u002F 3. Consume credentials\n    const consumeResponse = await fetch(\n      `${client.baseURL}\u002Fv1\u002Frealtime_sessions\u002F${sessionId}\u002Fconsume`,\n      {\n        method: 'POST',\n        headers: {\n          Authorization: `Bearer ${sessionKey}`,\n          'X-Runway-Version': '2024-11-06',\n        },\n      }\n    );\n    const credentials = await consumeResponse.json();\n\n    res.json({\n      sessionId,\n      serverUrl: credentials.url,\n      token: credentials.token,\n      roomName: credentials.roomName,\n    });\n  } catch (error) {\n    console.error('Session creation failed:', error);\n    res.status(500).json({ error: error instanceof Error ? error.message : 'Unknown error' });\n  }\n});\n```\n\n### FastAPI (Python)\n\n```python\nimport time\nimport httpx\nfrom fastapi import FastAPI, HTTPException\nfrom pydantic import BaseModel\nfrom runwayml import RunwayML\n\napp = FastAPI()\nclient = RunwayML()\n\nclass SessionRequest(BaseModel):\n    avatar_id: str\n\n@app.post(\"\u002Fapi\u002Favatar\u002Fsession\")\nasync def create_session(req: SessionRequest):\n    # 1. Create session\n    result = client.realtime_sessions.create(\n        model='gwm1_avatars',\n        avatar={'type': 'custom', 'avatar_id': req.avatar_id},\n    )\n    session_id = result.id\n\n    # 2. Poll until ready\n    session_key = None\n    for _ in range(60):\n        session = client.realtime_sessions.retrieve(session_id)\n\n        if session.status == 'READY':\n            session_key = session.session_key\n            break\n        if session.status == 'FAILED':\n            raise HTTPException(status_code=500, detail=str(session.failure))\n\n        time.sleep(1)\n\n    if not session_key:\n        raise HTTPException(status_code=504, detail='Session timed out')\n\n    # 3. Consume credentials\n    async with httpx.AsyncClient() as http:\n        resp = await http.post(\n            f\"{client.base_url}\u002Fv1\u002Frealtime_sessions\u002F{session_id}\u002Fconsume\",\n            headers={\n                \"Authorization\": f\"Bearer {session_key}\",\n                \"X-Runway-Version\": \"2024-11-06\",\n            },\n        )\n    credentials = resp.json()\n\n    return {\n        \"session_id\": session_id,\n        \"server_url\": credentials[\"url\"],\n        \"token\": credentials[\"token\"],\n        \"room_name\": credentials[\"roomName\"],\n    }\n```\n\n## Step 4: Connect from the Client\n\nSee `+rw-integrate-character-embed` for the React SDK components that handle WebRTC connection and rendering. The simplest approach:\n\n```tsx\n'use client';\nimport { AvatarCall } from '@runwayml\u002Favatars-react';\nimport '@runwayml\u002Favatars-react\u002Fstyles.css';\n\nexport default function CharacterPage() {\n  return (\n    \u003CAvatarCall\n      avatarId=\"your-avatar-id\"\n      connectUrl=\"\u002Fapi\u002Favatar\u002Fsession\"\n      onEnd={() => console.log('Call ended')}\n      onError={(error) => console.error('Error:', error)}\n    \u002F>\n  );\n}\n```\n\n## Troubleshooting\n\n- **API key errors:** Key starts with `key_` followed by 128 hex chars. Ensure it's active.\n- **No credits:** Account must have prepaid credits before starting a call.\n- **Session timeout:** The 60-iteration poll loop waits ~60 seconds. If sessions consistently time out, check your tier's concurrency limits.\n- **Credentials already consumed:** Session credentials are one-time use. If WebRTC fails after consume, create a new session.\n\n### Debug logging\n\n```tsx\n\u003CAvatarCall\n  avatarId=\"your-avatar-id\"\n  connectUrl=\"\u002Fapi\u002Favatar\u002Fsession\"\n  onError={(error) => {\n    console.error('Avatar error:', error);\n    console.error('Error name:', error.name);\n    console.error('Error message:', error.message);\n    if (error.cause) console.error('Cause:', error.cause);\n  }}\n\u002F>\n```\n\n### Monitor session state\n\n```tsx\nimport { useAvatarSession } from '@runwayml\u002Favatars-react';\n\nfunction DebugInfo() {\n  const { state, sessionId, error } = useAvatarSession();\n  return (\n    \u003Cpre>\n      {JSON.stringify({ state, sessionId, error: error?.message }, null, 2)}\n    \u003C\u002Fpre>\n  );\n}\n```\n\n### Test with minimal setup\n\n```bash\nnpx degit runwayml\u002Favatars-sdk-react\u002Fexamples\u002Fnextjs-simple test-app\ncd test-app\nnpm install\n# Add your API key to .env.local\nnpm run dev\n```\n\n## Browser Support\n\n| Browser | Minimum Version |\n|---------|-----------------|\n| Chrome | 74+ |\n| Firefox | 78+ |\n| Safari | 14.1+ |\n| Edge | 79+ |\n\nUsers must grant microphone permissions. Camera permissions needed if user video is enabled.\n\n## Getting Help\n\n| Resource | Description |\n|----------|-------------|\n| [Developer Portal](https:\u002F\u002Fdev.runwayml.com\u002F) | Manage avatars, view logs, access dashboard |\n| [SDK Repository](https:\u002F\u002Fgithub.com\u002Frunwayml\u002Favatars-sdk-react) | Report bugs, view examples, check releases |\n\nWhen reporting issues, include: browser\u002Fversion, SDK version (`npm list @runwayml\u002Favatars-react`), error messages, session ID, and steps to reproduce.\n",{"data":36,"body":39},{"name":4,"description":6,"user-invocable":37,"allowed-tools":38},false,"Read, Grep, Glob, Edit, Write",{"type":40,"children":41},"root",[42,51,147,152,165,177,184,191,256,262,274,413,433,439,444,453,523,529,566,591,597,616,622,719,725,1160,1294,1311,1674,1680,1698,1803,1824,1842,1868,1874,1917,1923,2015,2026,2032,2044,2050,3546,3552,5271,5277,5704,5710,5722,6076,6082,6133,6139,6492,6498,6777,6783,6862,6868,6942,6947,6953,7008,7021],{"type":43,"tag":44,"props":45,"children":47},"element","h1",{"id":46},"integrate-characters-gwm-1-avatars",[48],{"type":49,"value":50},"text","Integrate Characters (GWM-1 Avatars)",{"type":43,"tag":52,"props":53,"children":54},"blockquote",{},[55,65,114,122],{"type":43,"tag":56,"props":57,"children":58},"p",{},[59],{"type":43,"tag":60,"props":61,"children":62},"strong",{},[63],{"type":49,"value":64},"PREREQUISITES:",{"type":43,"tag":66,"props":67,"children":68},"ul",{},[69,82,103],{"type":43,"tag":70,"props":71,"children":72},"li",{},[73,80],{"type":43,"tag":74,"props":75,"children":77},"code",{"className":76},[],[78],{"type":49,"value":79},"+rw-check-compatibility",{"type":49,"value":81}," — Project must have a server-side component (API key must NEVER be exposed to the client)",{"type":43,"tag":70,"props":83,"children":84},{},[85,91,93,101],{"type":43,"tag":74,"props":86,"children":88},{"className":87},[],[89],{"type":49,"value":90},"+rw-fetch-api-reference",{"type":49,"value":92}," — Load the latest API reference from ",{"type":43,"tag":94,"props":95,"children":99},"a",{"href":96,"rel":97},"https:\u002F\u002Fdocs.dev.runwayml.com\u002Fapi\u002F",[98],"nofollow",[100],{"type":49,"value":96},{"type":49,"value":102}," before integrating",{"type":43,"tag":70,"props":104,"children":105},{},[106,112],{"type":43,"tag":74,"props":107,"children":109},{"className":108},[],[110],{"type":49,"value":111},"+rw-setup-api-key",{"type":49,"value":113}," — API credentials must be configured",{"type":43,"tag":56,"props":115,"children":116},{},[117],{"type":43,"tag":60,"props":118,"children":119},{},[120],{"type":49,"value":121},"OPTIONAL DEPENDENCIES:",{"type":43,"tag":66,"props":123,"children":124},{},[125,136],{"type":43,"tag":70,"props":126,"children":127},{},[128,134],{"type":43,"tag":74,"props":129,"children":131},{"className":130},[],[132],{"type":49,"value":133},"+rw-integrate-documents",{"type":49,"value":135}," — Add a knowledge base to your character",{"type":43,"tag":70,"props":137,"children":138},{},[139,145],{"type":43,"tag":74,"props":140,"children":142},{"className":141},[],[143],{"type":49,"value":144},"+rw-integrate-character-embed",{"type":49,"value":146}," — Use the React SDK to embed the avatar call UI",{"type":43,"tag":56,"props":148,"children":149},{},[150],{"type":49,"value":151},"Help users create Runway Characters — real-time conversational AI avatars powered by GWM-1.",{"type":43,"tag":56,"props":153,"children":154},{},[155,157,163],{"type":49,"value":156},"Use this only when modifying a user's codebase. For direct avatar management or other one-off Runway account actions from the agent, use ",{"type":43,"tag":74,"props":158,"children":160},{"className":159},[],[161],{"type":49,"value":162},"+use-runway-api",{"type":49,"value":164}," instead.",{"type":43,"tag":56,"props":166,"children":167},{},[168,170,175],{"type":49,"value":169},"Characters are generated from a ",{"type":43,"tag":60,"props":171,"children":172},{},[173],{"type":49,"value":174},"single image",{"type":49,"value":176}," (any visual style — photorealistic, animated, non-human) with full control over voice, personality, knowledge, and actions. No fine-tuning or training required.",{"type":43,"tag":178,"props":179,"children":181},"h2",{"id":180},"key-concepts",[182],{"type":49,"value":183},"Key Concepts",{"type":43,"tag":185,"props":186,"children":188},"h3",{"id":187},"avatars-vs-sessions",[189],{"type":49,"value":190},"Avatars vs Sessions",{"type":43,"tag":192,"props":193,"children":194},"table",{},[195,214],{"type":43,"tag":196,"props":197,"children":198},"thead",{},[199],{"type":43,"tag":200,"props":201,"children":202},"tr",{},[203,209],{"type":43,"tag":204,"props":205,"children":206},"th",{},[207],{"type":49,"value":208},"Concept",{"type":43,"tag":204,"props":210,"children":211},{},[212],{"type":49,"value":213},"Description",{"type":43,"tag":215,"props":216,"children":217},"tbody",{},[218,235],{"type":43,"tag":200,"props":219,"children":220},{},[221,230],{"type":43,"tag":222,"props":223,"children":224},"td",{},[225],{"type":43,"tag":60,"props":226,"children":227},{},[228],{"type":49,"value":229},"Avatar",{"type":43,"tag":222,"props":231,"children":232},{},[233],{"type":49,"value":234},"A persistent persona with a defined appearance, voice, and personality. Created once, used many times.",{"type":43,"tag":200,"props":236,"children":237},{},[238,246],{"type":43,"tag":222,"props":239,"children":240},{},[241],{"type":43,"tag":60,"props":242,"children":243},{},[244],{"type":49,"value":245},"Session",{"type":43,"tag":222,"props":247,"children":248},{},[249,251],{"type":49,"value":250},"A live WebRTC connection for real-time conversation. Connects one user to one avatar. ",{"type":43,"tag":60,"props":252,"children":253},{},[254],{"type":49,"value":255},"Max duration: 5 minutes.",{"type":43,"tag":185,"props":257,"children":259},{"id":258},"session-lifecycle",[260],{"type":49,"value":261},"Session Lifecycle",{"type":43,"tag":263,"props":264,"children":268},"pre",{"className":265,"code":267,"language":49},[266],"language-text","                    ┌───────────┐\n         ┌──────────┤ NOT_READY ├──────────┐\n         │          └─────┬─────┘          │\n         │                │                │\n         ▼                ▼                ▼\n     CANCELLED          READY           FAILED\n                       ┌──┴──┐\n                       │     │\n                       ▼     ▼\n                    RUNNING FAILED\n                    ┌──┴──┐\n                    │     │\n                    ▼     ▼\n                COMPLETED CANCELLED\n",[269],{"type":43,"tag":74,"props":270,"children":272},{"__ignoreMap":271},"",[273],{"type":49,"value":267},{"type":43,"tag":192,"props":275,"children":276},{},[277,292],{"type":43,"tag":196,"props":278,"children":279},{},[280],{"type":43,"tag":200,"props":281,"children":282},{},[283,288],{"type":43,"tag":204,"props":284,"children":285},{},[286],{"type":49,"value":287},"Status",{"type":43,"tag":204,"props":289,"children":290},{},[291],{"type":49,"value":213},{"type":43,"tag":215,"props":293,"children":294},{},[295,312,337,354,371,396],{"type":43,"tag":200,"props":296,"children":297},{},[298,307],{"type":43,"tag":222,"props":299,"children":300},{},[301],{"type":43,"tag":74,"props":302,"children":304},{"className":303},[],[305],{"type":49,"value":306},"NOT_READY",{"type":43,"tag":222,"props":308,"children":309},{},[310],{"type":49,"value":311},"Session is being provisioned. Poll until ready.",{"type":43,"tag":200,"props":313,"children":314},{},[315,324],{"type":43,"tag":222,"props":316,"children":317},{},[318],{"type":43,"tag":74,"props":319,"children":321},{"className":320},[],[322],{"type":49,"value":323},"READY",{"type":43,"tag":222,"props":325,"children":326},{},[327,329,335],{"type":49,"value":328},"Session is ready. The ",{"type":43,"tag":74,"props":330,"children":332},{"className":331},[],[333],{"type":49,"value":334},"sessionKey",{"type":49,"value":336}," is available.",{"type":43,"tag":200,"props":338,"children":339},{},[340,349],{"type":43,"tag":222,"props":341,"children":342},{},[343],{"type":43,"tag":74,"props":344,"children":346},{"className":345},[],[347],{"type":49,"value":348},"RUNNING",{"type":43,"tag":222,"props":350,"children":351},{},[352],{"type":49,"value":353},"WebRTC connection is active. Conversation in progress.",{"type":43,"tag":200,"props":355,"children":356},{},[357,366],{"type":43,"tag":222,"props":358,"children":359},{},[360],{"type":43,"tag":74,"props":361,"children":363},{"className":362},[],[364],{"type":49,"value":365},"COMPLETED",{"type":43,"tag":222,"props":367,"children":368},{},[369],{"type":49,"value":370},"Session ended normally.",{"type":43,"tag":200,"props":372,"children":373},{},[374,383],{"type":43,"tag":222,"props":375,"children":376},{},[377],{"type":43,"tag":74,"props":378,"children":380},{"className":379},[],[381],{"type":49,"value":382},"FAILED",{"type":43,"tag":222,"props":384,"children":385},{},[386,388,394],{"type":49,"value":387},"Error occurred. Check the ",{"type":43,"tag":74,"props":389,"children":391},{"className":390},[],[392],{"type":49,"value":393},"failure",{"type":49,"value":395}," field.",{"type":43,"tag":200,"props":397,"children":398},{},[399,408],{"type":43,"tag":222,"props":400,"children":401},{},[402],{"type":43,"tag":74,"props":403,"children":405},{"className":404},[],[406],{"type":49,"value":407},"CANCELLED",{"type":43,"tag":222,"props":409,"children":410},{},[411],{"type":49,"value":412},"Explicitly cancelled before completion.",{"type":43,"tag":52,"props":414,"children":415},{},[416],{"type":43,"tag":56,"props":417,"children":418},{},[419,424,426,431],{"type":43,"tag":60,"props":420,"children":421},{},[422],{"type":49,"value":423},"Important:",{"type":49,"value":425}," Session credentials can only be consumed ",{"type":43,"tag":60,"props":427,"children":428},{},[429],{"type":49,"value":430},"once",{"type":49,"value":432},". If the WebRTC connection fails after credentials are consumed, you must create a new Session.",{"type":43,"tag":185,"props":434,"children":436},{"id":435},"architecture",[437],{"type":49,"value":438},"Architecture",{"type":43,"tag":56,"props":440,"children":441},{},[442],{"type":49,"value":443},"The API key must stay server-side. The flow is:",{"type":43,"tag":263,"props":445,"children":448},{"className":446,"code":447,"language":49},[266],"Client (React)  →  Your Server  →  Runway API\n                                      ↓\nClient (React)  ←─── WebRTC ───← Runway (realtime)\n",[449],{"type":43,"tag":74,"props":450,"children":451},{"__ignoreMap":271},[452],{"type":49,"value":447},{"type":43,"tag":454,"props":455,"children":456},"ol",{},[457,469,482,501,513,518],{"type":43,"tag":70,"props":458,"children":459},{},[460,462,467],{"type":49,"value":461},"Client requests a session from ",{"type":43,"tag":60,"props":463,"children":464},{},[465],{"type":49,"value":466},"your",{"type":49,"value":468}," server",{"type":43,"tag":70,"props":470,"children":471},{},[472,474,480],{"type":49,"value":473},"Your server calls Runway API to create a session (",{"type":43,"tag":74,"props":475,"children":477},{"className":476},[],[478],{"type":49,"value":479},"POST \u002Fv1\u002Frealtime_sessions",{"type":49,"value":481},")",{"type":43,"tag":70,"props":483,"children":484},{},[485,487,492,494,500],{"type":49,"value":486},"Your server polls until session is ",{"type":43,"tag":74,"props":488,"children":490},{"className":489},[],[491],{"type":49,"value":323},{"type":49,"value":493}," (",{"type":43,"tag":74,"props":495,"children":497},{"className":496},[],[498],{"type":49,"value":499},"GET \u002Fv1\u002Frealtime_sessions\u002F:id",{"type":49,"value":481},{"type":43,"tag":70,"props":502,"children":503},{},[504,506,512],{"type":49,"value":505},"Your server consumes credentials (",{"type":43,"tag":74,"props":507,"children":509},{"className":508},[],[510],{"type":49,"value":511},"POST \u002Fv1\u002Frealtime_sessions\u002F:id\u002Fconsume",{"type":49,"value":481},{"type":43,"tag":70,"props":514,"children":515},{},[516],{"type":49,"value":517},"Your server returns credentials to the client",{"type":43,"tag":70,"props":519,"children":520},{},[521],{"type":49,"value":522},"Client establishes a direct WebRTC connection to Runway",{"type":43,"tag":178,"props":524,"children":526},{"id":525},"step-1-install-dependencies",[527],{"type":49,"value":528},"Step 1: Install Dependencies",{"type":43,"tag":263,"props":530,"children":534},{"className":531,"code":532,"language":533,"meta":271,"style":271},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","npm install @runwayml\u002Fsdk @runwayml\u002Favatars-react\n","bash",[535],{"type":43,"tag":74,"props":536,"children":537},{"__ignoreMap":271},[538],{"type":43,"tag":539,"props":540,"children":543},"span",{"class":541,"line":542},"line",1,[544,550,556,561],{"type":43,"tag":539,"props":545,"children":547},{"style":546},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[548],{"type":49,"value":549},"npm",{"type":43,"tag":539,"props":551,"children":553},{"style":552},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[554],{"type":49,"value":555}," install",{"type":43,"tag":539,"props":557,"children":558},{"style":552},[559],{"type":49,"value":560}," @runwayml\u002Fsdk",{"type":43,"tag":539,"props":562,"children":563},{"style":552},[564],{"type":49,"value":565}," @runwayml\u002Favatars-react\n",{"type":43,"tag":66,"props":567,"children":568},{},[569,580],{"type":43,"tag":70,"props":570,"children":571},{},[572,578],{"type":43,"tag":74,"props":573,"children":575},{"className":574},[],[576],{"type":49,"value":577},"@runwayml\u002Fsdk",{"type":49,"value":579}," — Server-side SDK (session creation, avatar management)",{"type":43,"tag":70,"props":581,"children":582},{},[583,589],{"type":43,"tag":74,"props":584,"children":586},{"className":585},[],[587],{"type":49,"value":588},"@runwayml\u002Favatars-react",{"type":49,"value":590}," — Client-side React components (WebRTC, UI)",{"type":43,"tag":178,"props":592,"children":594},{"id":593},"step-2-create-an-avatar",[595],{"type":49,"value":596},"Step 2: Create an Avatar",{"type":43,"tag":56,"props":598,"children":599},{},[600,602,607,609,614],{"type":49,"value":601},"Avatars can be created via the ",{"type":43,"tag":60,"props":603,"children":604},{},[605],{"type":49,"value":606},"Developer Portal",{"type":49,"value":608}," (UI) or the ",{"type":43,"tag":60,"props":610,"children":611},{},[612],{"type":49,"value":613},"API",{"type":49,"value":615}," (programmatic).",{"type":43,"tag":185,"props":617,"children":619},{"id":618},"option-a-developer-portal-recommended-for-first-time",[620],{"type":49,"value":621},"Option A: Developer Portal (Recommended for first time)",{"type":43,"tag":454,"props":623,"children":624},{},[625,648,658,663,668,673,678,691,700],{"type":43,"tag":70,"props":626,"children":627},{},[628,630,639,641,646],{"type":49,"value":629},"Go to ",{"type":43,"tag":60,"props":631,"children":632},{},[633],{"type":43,"tag":94,"props":634,"children":637},{"href":635,"rel":636},"https:\u002F\u002Fdev.runwayml.com\u002F",[98],[638],{"type":49,"value":635},{"type":49,"value":640}," → ",{"type":43,"tag":60,"props":642,"children":643},{},[644],{"type":49,"value":645},"Characters",{"type":49,"value":647}," tab",{"type":43,"tag":70,"props":649,"children":650},{},[651,653],{"type":49,"value":652},"Click ",{"type":43,"tag":60,"props":654,"children":655},{},[656],{"type":49,"value":657},"Create a Character",{"type":43,"tag":70,"props":659,"children":660},{},[661],{"type":49,"value":662},"Upload a reference image (tips below)",{"type":43,"tag":70,"props":664,"children":665},{},[666],{"type":49,"value":667},"Choose a voice preset",{"type":43,"tag":70,"props":669,"children":670},{},[671],{"type":49,"value":672},"Write personality instructions (e.g., \"You are a helpful customer support agent for Acme Corp...\")",{"type":43,"tag":70,"props":674,"children":675},{},[676],{"type":49,"value":677},"Optionally add a starting script (what the character says first)",{"type":43,"tag":70,"props":679,"children":680},{},[681,683,689],{"type":49,"value":682},"Optionally upload knowledge documents (",{"type":43,"tag":74,"props":684,"children":686},{"className":685},[],[687],{"type":49,"value":688},".txt",{"type":49,"value":690}," files)",{"type":43,"tag":70,"props":692,"children":693},{},[694,695],{"type":49,"value":652},{"type":43,"tag":60,"props":696,"children":697},{},[698],{"type":49,"value":699},"Create Character",{"type":43,"tag":70,"props":701,"children":702},{},[703,705,710,712,718],{"type":49,"value":704},"Copy the ",{"type":43,"tag":60,"props":706,"children":707},{},[708],{"type":49,"value":709},"Avatar ID",{"type":49,"value":711}," (a UUID like ",{"type":43,"tag":74,"props":713,"children":715},{"className":714},[],[716],{"type":49,"value":717},"8be4df61-93ca-11d2-aa0d-00e098032b8c",{"type":49,"value":481},{"type":43,"tag":185,"props":720,"children":722},{"id":721},"option-b-api-programmatic",[723],{"type":49,"value":724},"Option B: API (Programmatic)",{"type":43,"tag":263,"props":726,"children":730},{"className":727,"code":728,"language":729,"meta":271,"style":271},"language-javascript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F Node.js\nimport RunwayML from '@runwayml\u002Fsdk';\n\nconst client = new RunwayML();\n\nconst avatar = await client.avatars.create({\n  name: 'Support Agent',\n  referenceImage: 'https:\u002F\u002Fexample.com\u002Favatar.png',\n  voice: {\n    type: 'runway-live-preset',\n    presetId: 'clara',\n  },\n  personality: 'You are a helpful customer support agent for Acme Corp. You help users with billing questions and technical issues.',\n});\n\nconsole.log('Avatar ID:', avatar.id);\n","javascript",[731],{"type":43,"tag":74,"props":732,"children":733},{"__ignoreMap":271},[734,743,784,794,834,842,898,931,961,979,1009,1039,1048,1078,1095,1102],{"type":43,"tag":539,"props":735,"children":736},{"class":541,"line":542},[737],{"type":43,"tag":539,"props":738,"children":740},{"style":739},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[741],{"type":49,"value":742},"\u002F\u002F Node.js\n",{"type":43,"tag":539,"props":744,"children":746},{"class":541,"line":745},2,[747,753,759,764,770,774,779],{"type":43,"tag":539,"props":748,"children":750},{"style":749},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[751],{"type":49,"value":752},"import",{"type":43,"tag":539,"props":754,"children":756},{"style":755},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[757],{"type":49,"value":758}," RunwayML ",{"type":43,"tag":539,"props":760,"children":761},{"style":749},[762],{"type":49,"value":763},"from",{"type":43,"tag":539,"props":765,"children":767},{"style":766},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[768],{"type":49,"value":769}," '",{"type":43,"tag":539,"props":771,"children":772},{"style":552},[773],{"type":49,"value":577},{"type":43,"tag":539,"props":775,"children":776},{"style":766},[777],{"type":49,"value":778},"'",{"type":43,"tag":539,"props":780,"children":781},{"style":766},[782],{"type":49,"value":783},";\n",{"type":43,"tag":539,"props":785,"children":787},{"class":541,"line":786},3,[788],{"type":43,"tag":539,"props":789,"children":791},{"emptyLinePlaceholder":790},true,[792],{"type":49,"value":793},"\n",{"type":43,"tag":539,"props":795,"children":797},{"class":541,"line":796},4,[798,804,809,814,819,825,830],{"type":43,"tag":539,"props":799,"children":801},{"style":800},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[802],{"type":49,"value":803},"const",{"type":43,"tag":539,"props":805,"children":806},{"style":755},[807],{"type":49,"value":808}," client ",{"type":43,"tag":539,"props":810,"children":811},{"style":766},[812],{"type":49,"value":813},"=",{"type":43,"tag":539,"props":815,"children":816},{"style":766},[817],{"type":49,"value":818}," new",{"type":43,"tag":539,"props":820,"children":822},{"style":821},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[823],{"type":49,"value":824}," RunwayML",{"type":43,"tag":539,"props":826,"children":827},{"style":755},[828],{"type":49,"value":829},"()",{"type":43,"tag":539,"props":831,"children":832},{"style":766},[833],{"type":49,"value":783},{"type":43,"tag":539,"props":835,"children":837},{"class":541,"line":836},5,[838],{"type":43,"tag":539,"props":839,"children":840},{"emptyLinePlaceholder":790},[841],{"type":49,"value":793},{"type":43,"tag":539,"props":843,"children":845},{"class":541,"line":844},6,[846,850,855,859,864,869,874,879,883,888,893],{"type":43,"tag":539,"props":847,"children":848},{"style":800},[849],{"type":49,"value":803},{"type":43,"tag":539,"props":851,"children":852},{"style":755},[853],{"type":49,"value":854}," avatar ",{"type":43,"tag":539,"props":856,"children":857},{"style":766},[858],{"type":49,"value":813},{"type":43,"tag":539,"props":860,"children":861},{"style":749},[862],{"type":49,"value":863}," await",{"type":43,"tag":539,"props":865,"children":866},{"style":755},[867],{"type":49,"value":868}," client",{"type":43,"tag":539,"props":870,"children":871},{"style":766},[872],{"type":49,"value":873},".",{"type":43,"tag":539,"props":875,"children":876},{"style":755},[877],{"type":49,"value":878},"avatars",{"type":43,"tag":539,"props":880,"children":881},{"style":766},[882],{"type":49,"value":873},{"type":43,"tag":539,"props":884,"children":885},{"style":821},[886],{"type":49,"value":887},"create",{"type":43,"tag":539,"props":889,"children":890},{"style":755},[891],{"type":49,"value":892},"(",{"type":43,"tag":539,"props":894,"children":895},{"style":766},[896],{"type":49,"value":897},"{\n",{"type":43,"tag":539,"props":899,"children":901},{"class":541,"line":900},7,[902,908,913,917,922,926],{"type":43,"tag":539,"props":903,"children":905},{"style":904},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[906],{"type":49,"value":907},"  name",{"type":43,"tag":539,"props":909,"children":910},{"style":766},[911],{"type":49,"value":912},":",{"type":43,"tag":539,"props":914,"children":915},{"style":766},[916],{"type":49,"value":769},{"type":43,"tag":539,"props":918,"children":919},{"style":552},[920],{"type":49,"value":921},"Support Agent",{"type":43,"tag":539,"props":923,"children":924},{"style":766},[925],{"type":49,"value":778},{"type":43,"tag":539,"props":927,"children":928},{"style":766},[929],{"type":49,"value":930},",\n",{"type":43,"tag":539,"props":932,"children":934},{"class":541,"line":933},8,[935,940,944,948,953,957],{"type":43,"tag":539,"props":936,"children":937},{"style":904},[938],{"type":49,"value":939},"  referenceImage",{"type":43,"tag":539,"props":941,"children":942},{"style":766},[943],{"type":49,"value":912},{"type":43,"tag":539,"props":945,"children":946},{"style":766},[947],{"type":49,"value":769},{"type":43,"tag":539,"props":949,"children":950},{"style":552},[951],{"type":49,"value":952},"https:\u002F\u002Fexample.com\u002Favatar.png",{"type":43,"tag":539,"props":954,"children":955},{"style":766},[956],{"type":49,"value":778},{"type":43,"tag":539,"props":958,"children":959},{"style":766},[960],{"type":49,"value":930},{"type":43,"tag":539,"props":962,"children":964},{"class":541,"line":963},9,[965,970,974],{"type":43,"tag":539,"props":966,"children":967},{"style":904},[968],{"type":49,"value":969},"  voice",{"type":43,"tag":539,"props":971,"children":972},{"style":766},[973],{"type":49,"value":912},{"type":43,"tag":539,"props":975,"children":976},{"style":766},[977],{"type":49,"value":978}," {\n",{"type":43,"tag":539,"props":980,"children":982},{"class":541,"line":981},10,[983,988,992,996,1001,1005],{"type":43,"tag":539,"props":984,"children":985},{"style":904},[986],{"type":49,"value":987},"    type",{"type":43,"tag":539,"props":989,"children":990},{"style":766},[991],{"type":49,"value":912},{"type":43,"tag":539,"props":993,"children":994},{"style":766},[995],{"type":49,"value":769},{"type":43,"tag":539,"props":997,"children":998},{"style":552},[999],{"type":49,"value":1000},"runway-live-preset",{"type":43,"tag":539,"props":1002,"children":1003},{"style":766},[1004],{"type":49,"value":778},{"type":43,"tag":539,"props":1006,"children":1007},{"style":766},[1008],{"type":49,"value":930},{"type":43,"tag":539,"props":1010,"children":1012},{"class":541,"line":1011},11,[1013,1018,1022,1026,1031,1035],{"type":43,"tag":539,"props":1014,"children":1015},{"style":904},[1016],{"type":49,"value":1017},"    presetId",{"type":43,"tag":539,"props":1019,"children":1020},{"style":766},[1021],{"type":49,"value":912},{"type":43,"tag":539,"props":1023,"children":1024},{"style":766},[1025],{"type":49,"value":769},{"type":43,"tag":539,"props":1027,"children":1028},{"style":552},[1029],{"type":49,"value":1030},"clara",{"type":43,"tag":539,"props":1032,"children":1033},{"style":766},[1034],{"type":49,"value":778},{"type":43,"tag":539,"props":1036,"children":1037},{"style":766},[1038],{"type":49,"value":930},{"type":43,"tag":539,"props":1040,"children":1042},{"class":541,"line":1041},12,[1043],{"type":43,"tag":539,"props":1044,"children":1045},{"style":766},[1046],{"type":49,"value":1047},"  },\n",{"type":43,"tag":539,"props":1049,"children":1051},{"class":541,"line":1050},13,[1052,1057,1061,1065,1070,1074],{"type":43,"tag":539,"props":1053,"children":1054},{"style":904},[1055],{"type":49,"value":1056},"  personality",{"type":43,"tag":539,"props":1058,"children":1059},{"style":766},[1060],{"type":49,"value":912},{"type":43,"tag":539,"props":1062,"children":1063},{"style":766},[1064],{"type":49,"value":769},{"type":43,"tag":539,"props":1066,"children":1067},{"style":552},[1068],{"type":49,"value":1069},"You are a helpful customer support agent for Acme Corp. You help users with billing questions and technical issues.",{"type":43,"tag":539,"props":1071,"children":1072},{"style":766},[1073],{"type":49,"value":778},{"type":43,"tag":539,"props":1075,"children":1076},{"style":766},[1077],{"type":49,"value":930},{"type":43,"tag":539,"props":1079,"children":1081},{"class":541,"line":1080},14,[1082,1087,1091],{"type":43,"tag":539,"props":1083,"children":1084},{"style":766},[1085],{"type":49,"value":1086},"}",{"type":43,"tag":539,"props":1088,"children":1089},{"style":755},[1090],{"type":49,"value":481},{"type":43,"tag":539,"props":1092,"children":1093},{"style":766},[1094],{"type":49,"value":783},{"type":43,"tag":539,"props":1096,"children":1097},{"class":541,"line":28},[1098],{"type":43,"tag":539,"props":1099,"children":1100},{"emptyLinePlaceholder":790},[1101],{"type":49,"value":793},{"type":43,"tag":539,"props":1103,"children":1105},{"class":541,"line":1104},16,[1106,1111,1115,1120,1124,1128,1133,1137,1142,1147,1151,1156],{"type":43,"tag":539,"props":1107,"children":1108},{"style":755},[1109],{"type":49,"value":1110},"console",{"type":43,"tag":539,"props":1112,"children":1113},{"style":766},[1114],{"type":49,"value":873},{"type":43,"tag":539,"props":1116,"children":1117},{"style":821},[1118],{"type":49,"value":1119},"log",{"type":43,"tag":539,"props":1121,"children":1122},{"style":755},[1123],{"type":49,"value":892},{"type":43,"tag":539,"props":1125,"children":1126},{"style":766},[1127],{"type":49,"value":778},{"type":43,"tag":539,"props":1129,"children":1130},{"style":552},[1131],{"type":49,"value":1132},"Avatar ID:",{"type":43,"tag":539,"props":1134,"children":1135},{"style":766},[1136],{"type":49,"value":778},{"type":43,"tag":539,"props":1138,"children":1139},{"style":766},[1140],{"type":49,"value":1141},",",{"type":43,"tag":539,"props":1143,"children":1144},{"style":755},[1145],{"type":49,"value":1146}," avatar",{"type":43,"tag":539,"props":1148,"children":1149},{"style":766},[1150],{"type":49,"value":873},{"type":43,"tag":539,"props":1152,"children":1153},{"style":755},[1154],{"type":49,"value":1155},"id)",{"type":43,"tag":539,"props":1157,"children":1158},{"style":766},[1159],{"type":49,"value":783},{"type":43,"tag":263,"props":1161,"children":1165},{"className":1162,"code":1163,"language":1164,"meta":271,"style":271},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# Python\nfrom runwayml import RunwayML\n\nclient = RunwayML()\n\navatar = client.avatars.create(\n    name='Support Agent',\n    reference_image='https:\u002F\u002Fexample.com\u002Favatar.png',\n    voice={\n        'type': 'runway-live-preset',\n        'preset_id': 'clara',\n    },\n    personality='You are a helpful customer support agent for Acme Corp.',\n)\n\nprint('Avatar ID:', avatar.id)\n","python",[1166],{"type":43,"tag":74,"props":1167,"children":1168},{"__ignoreMap":271},[1169,1177,1185,1192,1200,1207,1215,1223,1231,1239,1247,1255,1263,1271,1279,1286],{"type":43,"tag":539,"props":1170,"children":1171},{"class":541,"line":542},[1172],{"type":43,"tag":539,"props":1173,"children":1174},{},[1175],{"type":49,"value":1176},"# Python\n",{"type":43,"tag":539,"props":1178,"children":1179},{"class":541,"line":745},[1180],{"type":43,"tag":539,"props":1181,"children":1182},{},[1183],{"type":49,"value":1184},"from runwayml import RunwayML\n",{"type":43,"tag":539,"props":1186,"children":1187},{"class":541,"line":786},[1188],{"type":43,"tag":539,"props":1189,"children":1190},{"emptyLinePlaceholder":790},[1191],{"type":49,"value":793},{"type":43,"tag":539,"props":1193,"children":1194},{"class":541,"line":796},[1195],{"type":43,"tag":539,"props":1196,"children":1197},{},[1198],{"type":49,"value":1199},"client = RunwayML()\n",{"type":43,"tag":539,"props":1201,"children":1202},{"class":541,"line":836},[1203],{"type":43,"tag":539,"props":1204,"children":1205},{"emptyLinePlaceholder":790},[1206],{"type":49,"value":793},{"type":43,"tag":539,"props":1208,"children":1209},{"class":541,"line":844},[1210],{"type":43,"tag":539,"props":1211,"children":1212},{},[1213],{"type":49,"value":1214},"avatar = client.avatars.create(\n",{"type":43,"tag":539,"props":1216,"children":1217},{"class":541,"line":900},[1218],{"type":43,"tag":539,"props":1219,"children":1220},{},[1221],{"type":49,"value":1222},"    name='Support Agent',\n",{"type":43,"tag":539,"props":1224,"children":1225},{"class":541,"line":933},[1226],{"type":43,"tag":539,"props":1227,"children":1228},{},[1229],{"type":49,"value":1230},"    reference_image='https:\u002F\u002Fexample.com\u002Favatar.png',\n",{"type":43,"tag":539,"props":1232,"children":1233},{"class":541,"line":963},[1234],{"type":43,"tag":539,"props":1235,"children":1236},{},[1237],{"type":49,"value":1238},"    voice={\n",{"type":43,"tag":539,"props":1240,"children":1241},{"class":541,"line":981},[1242],{"type":43,"tag":539,"props":1243,"children":1244},{},[1245],{"type":49,"value":1246},"        'type': 'runway-live-preset',\n",{"type":43,"tag":539,"props":1248,"children":1249},{"class":541,"line":1011},[1250],{"type":43,"tag":539,"props":1251,"children":1252},{},[1253],{"type":49,"value":1254},"        'preset_id': 'clara',\n",{"type":43,"tag":539,"props":1256,"children":1257},{"class":541,"line":1041},[1258],{"type":43,"tag":539,"props":1259,"children":1260},{},[1261],{"type":49,"value":1262},"    },\n",{"type":43,"tag":539,"props":1264,"children":1265},{"class":541,"line":1050},[1266],{"type":43,"tag":539,"props":1267,"children":1268},{},[1269],{"type":49,"value":1270},"    personality='You are a helpful customer support agent for Acme Corp.',\n",{"type":43,"tag":539,"props":1272,"children":1273},{"class":541,"line":1080},[1274],{"type":43,"tag":539,"props":1275,"children":1276},{},[1277],{"type":49,"value":1278},")\n",{"type":43,"tag":539,"props":1280,"children":1281},{"class":541,"line":28},[1282],{"type":43,"tag":539,"props":1283,"children":1284},{"emptyLinePlaceholder":790},[1285],{"type":49,"value":793},{"type":43,"tag":539,"props":1287,"children":1288},{"class":541,"line":1104},[1289],{"type":43,"tag":539,"props":1290,"children":1291},{},[1292],{"type":49,"value":1293},"print('Avatar ID:', avatar.id)\n",{"type":43,"tag":56,"props":1295,"children":1296},{},[1297,1302,1304,1310],{"type":43,"tag":60,"props":1298,"children":1299},{},[1300],{"type":49,"value":1301},"If the reference image is a local file",{"type":49,"value":1303},", upload it first using ",{"type":43,"tag":74,"props":1305,"children":1307},{"className":1306},[],[1308],{"type":49,"value":1309},"+rw-integrate-uploads",{"type":49,"value":912},{"type":43,"tag":263,"props":1312,"children":1314},{"className":727,"code":1313,"language":729,"meta":271,"style":271},"import fs from 'fs';\n\nconst upload = await client.uploads.createEphemeral(\n  fs.createReadStream('\u002Fpath\u002Fto\u002Favatar-image.png')\n);\n\nconst avatar = await client.avatars.create({\n  name: 'Support Agent',\n  referenceImage: upload.runwayUri,\n  voice: { type: 'runway-live-preset', presetId: 'clara' },\n  personality: 'You are a helpful customer support agent...',\n});\n",[1315],{"type":43,"tag":74,"props":1316,"children":1317},{"__ignoreMap":271},[1318,1351,1358,1405,1443,1454,1461,1508,1535,1564,1631,1659],{"type":43,"tag":539,"props":1319,"children":1320},{"class":541,"line":542},[1321,1325,1330,1334,1338,1343,1347],{"type":43,"tag":539,"props":1322,"children":1323},{"style":749},[1324],{"type":49,"value":752},{"type":43,"tag":539,"props":1326,"children":1327},{"style":755},[1328],{"type":49,"value":1329}," fs ",{"type":43,"tag":539,"props":1331,"children":1332},{"style":749},[1333],{"type":49,"value":763},{"type":43,"tag":539,"props":1335,"children":1336},{"style":766},[1337],{"type":49,"value":769},{"type":43,"tag":539,"props":1339,"children":1340},{"style":552},[1341],{"type":49,"value":1342},"fs",{"type":43,"tag":539,"props":1344,"children":1345},{"style":766},[1346],{"type":49,"value":778},{"type":43,"tag":539,"props":1348,"children":1349},{"style":766},[1350],{"type":49,"value":783},{"type":43,"tag":539,"props":1352,"children":1353},{"class":541,"line":745},[1354],{"type":43,"tag":539,"props":1355,"children":1356},{"emptyLinePlaceholder":790},[1357],{"type":49,"value":793},{"type":43,"tag":539,"props":1359,"children":1360},{"class":541,"line":786},[1361,1365,1370,1374,1378,1382,1386,1391,1395,1400],{"type":43,"tag":539,"props":1362,"children":1363},{"style":800},[1364],{"type":49,"value":803},{"type":43,"tag":539,"props":1366,"children":1367},{"style":755},[1368],{"type":49,"value":1369}," upload ",{"type":43,"tag":539,"props":1371,"children":1372},{"style":766},[1373],{"type":49,"value":813},{"type":43,"tag":539,"props":1375,"children":1376},{"style":749},[1377],{"type":49,"value":863},{"type":43,"tag":539,"props":1379,"children":1380},{"style":755},[1381],{"type":49,"value":868},{"type":43,"tag":539,"props":1383,"children":1384},{"style":766},[1385],{"type":49,"value":873},{"type":43,"tag":539,"props":1387,"children":1388},{"style":755},[1389],{"type":49,"value":1390},"uploads",{"type":43,"tag":539,"props":1392,"children":1393},{"style":766},[1394],{"type":49,"value":873},{"type":43,"tag":539,"props":1396,"children":1397},{"style":821},[1398],{"type":49,"value":1399},"createEphemeral",{"type":43,"tag":539,"props":1401,"children":1402},{"style":755},[1403],{"type":49,"value":1404},"(\n",{"type":43,"tag":539,"props":1406,"children":1407},{"class":541,"line":796},[1408,1413,1417,1422,1426,1430,1435,1439],{"type":43,"tag":539,"props":1409,"children":1410},{"style":755},[1411],{"type":49,"value":1412},"  fs",{"type":43,"tag":539,"props":1414,"children":1415},{"style":766},[1416],{"type":49,"value":873},{"type":43,"tag":539,"props":1418,"children":1419},{"style":821},[1420],{"type":49,"value":1421},"createReadStream",{"type":43,"tag":539,"props":1423,"children":1424},{"style":755},[1425],{"type":49,"value":892},{"type":43,"tag":539,"props":1427,"children":1428},{"style":766},[1429],{"type":49,"value":778},{"type":43,"tag":539,"props":1431,"children":1432},{"style":552},[1433],{"type":49,"value":1434},"\u002Fpath\u002Fto\u002Favatar-image.png",{"type":43,"tag":539,"props":1436,"children":1437},{"style":766},[1438],{"type":49,"value":778},{"type":43,"tag":539,"props":1440,"children":1441},{"style":755},[1442],{"type":49,"value":1278},{"type":43,"tag":539,"props":1444,"children":1445},{"class":541,"line":836},[1446,1450],{"type":43,"tag":539,"props":1447,"children":1448},{"style":755},[1449],{"type":49,"value":481},{"type":43,"tag":539,"props":1451,"children":1452},{"style":766},[1453],{"type":49,"value":783},{"type":43,"tag":539,"props":1455,"children":1456},{"class":541,"line":844},[1457],{"type":43,"tag":539,"props":1458,"children":1459},{"emptyLinePlaceholder":790},[1460],{"type":49,"value":793},{"type":43,"tag":539,"props":1462,"children":1463},{"class":541,"line":900},[1464,1468,1472,1476,1480,1484,1488,1492,1496,1500,1504],{"type":43,"tag":539,"props":1465,"children":1466},{"style":800},[1467],{"type":49,"value":803},{"type":43,"tag":539,"props":1469,"children":1470},{"style":755},[1471],{"type":49,"value":854},{"type":43,"tag":539,"props":1473,"children":1474},{"style":766},[1475],{"type":49,"value":813},{"type":43,"tag":539,"props":1477,"children":1478},{"style":749},[1479],{"type":49,"value":863},{"type":43,"tag":539,"props":1481,"children":1482},{"style":755},[1483],{"type":49,"value":868},{"type":43,"tag":539,"props":1485,"children":1486},{"style":766},[1487],{"type":49,"value":873},{"type":43,"tag":539,"props":1489,"children":1490},{"style":755},[1491],{"type":49,"value":878},{"type":43,"tag":539,"props":1493,"children":1494},{"style":766},[1495],{"type":49,"value":873},{"type":43,"tag":539,"props":1497,"children":1498},{"style":821},[1499],{"type":49,"value":887},{"type":43,"tag":539,"props":1501,"children":1502},{"style":755},[1503],{"type":49,"value":892},{"type":43,"tag":539,"props":1505,"children":1506},{"style":766},[1507],{"type":49,"value":897},{"type":43,"tag":539,"props":1509,"children":1510},{"class":541,"line":933},[1511,1515,1519,1523,1527,1531],{"type":43,"tag":539,"props":1512,"children":1513},{"style":904},[1514],{"type":49,"value":907},{"type":43,"tag":539,"props":1516,"children":1517},{"style":766},[1518],{"type":49,"value":912},{"type":43,"tag":539,"props":1520,"children":1521},{"style":766},[1522],{"type":49,"value":769},{"type":43,"tag":539,"props":1524,"children":1525},{"style":552},[1526],{"type":49,"value":921},{"type":43,"tag":539,"props":1528,"children":1529},{"style":766},[1530],{"type":49,"value":778},{"type":43,"tag":539,"props":1532,"children":1533},{"style":766},[1534],{"type":49,"value":930},{"type":43,"tag":539,"props":1536,"children":1537},{"class":541,"line":963},[1538,1542,1546,1551,1555,1560],{"type":43,"tag":539,"props":1539,"children":1540},{"style":904},[1541],{"type":49,"value":939},{"type":43,"tag":539,"props":1543,"children":1544},{"style":766},[1545],{"type":49,"value":912},{"type":43,"tag":539,"props":1547,"children":1548},{"style":755},[1549],{"type":49,"value":1550}," upload",{"type":43,"tag":539,"props":1552,"children":1553},{"style":766},[1554],{"type":49,"value":873},{"type":43,"tag":539,"props":1556,"children":1557},{"style":755},[1558],{"type":49,"value":1559},"runwayUri",{"type":43,"tag":539,"props":1561,"children":1562},{"style":766},[1563],{"type":49,"value":930},{"type":43,"tag":539,"props":1565,"children":1566},{"class":541,"line":981},[1567,1571,1575,1580,1585,1589,1593,1597,1601,1605,1610,1614,1618,1622,1626],{"type":43,"tag":539,"props":1568,"children":1569},{"style":904},[1570],{"type":49,"value":969},{"type":43,"tag":539,"props":1572,"children":1573},{"style":766},[1574],{"type":49,"value":912},{"type":43,"tag":539,"props":1576,"children":1577},{"style":766},[1578],{"type":49,"value":1579}," {",{"type":43,"tag":539,"props":1581,"children":1582},{"style":904},[1583],{"type":49,"value":1584}," type",{"type":43,"tag":539,"props":1586,"children":1587},{"style":766},[1588],{"type":49,"value":912},{"type":43,"tag":539,"props":1590,"children":1591},{"style":766},[1592],{"type":49,"value":769},{"type":43,"tag":539,"props":1594,"children":1595},{"style":552},[1596],{"type":49,"value":1000},{"type":43,"tag":539,"props":1598,"children":1599},{"style":766},[1600],{"type":49,"value":778},{"type":43,"tag":539,"props":1602,"children":1603},{"style":766},[1604],{"type":49,"value":1141},{"type":43,"tag":539,"props":1606,"children":1607},{"style":904},[1608],{"type":49,"value":1609}," presetId",{"type":43,"tag":539,"props":1611,"children":1612},{"style":766},[1613],{"type":49,"value":912},{"type":43,"tag":539,"props":1615,"children":1616},{"style":766},[1617],{"type":49,"value":769},{"type":43,"tag":539,"props":1619,"children":1620},{"style":552},[1621],{"type":49,"value":1030},{"type":43,"tag":539,"props":1623,"children":1624},{"style":766},[1625],{"type":49,"value":778},{"type":43,"tag":539,"props":1627,"children":1628},{"style":766},[1629],{"type":49,"value":1630}," },\n",{"type":43,"tag":539,"props":1632,"children":1633},{"class":541,"line":1011},[1634,1638,1642,1646,1651,1655],{"type":43,"tag":539,"props":1635,"children":1636},{"style":904},[1637],{"type":49,"value":1056},{"type":43,"tag":539,"props":1639,"children":1640},{"style":766},[1641],{"type":49,"value":912},{"type":43,"tag":539,"props":1643,"children":1644},{"style":766},[1645],{"type":49,"value":769},{"type":43,"tag":539,"props":1647,"children":1648},{"style":552},[1649],{"type":49,"value":1650},"You are a helpful customer support agent...",{"type":43,"tag":539,"props":1652,"children":1653},{"style":766},[1654],{"type":49,"value":778},{"type":43,"tag":539,"props":1656,"children":1657},{"style":766},[1658],{"type":49,"value":930},{"type":43,"tag":539,"props":1660,"children":1661},{"class":541,"line":1041},[1662,1666,1670],{"type":43,"tag":539,"props":1663,"children":1664},{"style":766},[1665],{"type":49,"value":1086},{"type":43,"tag":539,"props":1667,"children":1668},{"style":755},[1669],{"type":49,"value":481},{"type":43,"tag":539,"props":1671,"children":1672},{"style":766},[1673],{"type":49,"value":783},{"type":43,"tag":185,"props":1675,"children":1677},{"id":1676},"reference-image-required",[1678],{"type":49,"value":1679},"Reference Image (Required)",{"type":43,"tag":56,"props":1681,"children":1682},{},[1683,1689,1691,1696],{"type":43,"tag":74,"props":1684,"children":1686},{"className":1685},[],[1687],{"type":49,"value":1688},"referenceImage",{"type":49,"value":1690}," is ",{"type":43,"tag":60,"props":1692,"children":1693},{},[1694],{"type":49,"value":1695},"required",{"type":49,"value":1697}," when creating an avatar. It accepts three formats:",{"type":43,"tag":192,"props":1699,"children":1700},{},[1701,1722],{"type":43,"tag":196,"props":1702,"children":1703},{},[1704],{"type":43,"tag":200,"props":1705,"children":1706},{},[1707,1712,1717],{"type":43,"tag":204,"props":1708,"children":1709},{},[1710],{"type":49,"value":1711},"Format",{"type":43,"tag":204,"props":1713,"children":1714},{},[1715],{"type":49,"value":1716},"Limit",{"type":43,"tag":204,"props":1718,"children":1719},{},[1720],{"type":49,"value":1721},"When to use",{"type":43,"tag":215,"props":1723,"children":1724},{},[1725,1749,1771],{"type":43,"tag":200,"props":1726,"children":1727},{},[1728,1739,1744],{"type":43,"tag":222,"props":1729,"children":1730},{},[1731,1737],{"type":43,"tag":74,"props":1732,"children":1734},{"className":1733},[],[1735],{"type":49,"value":1736},"https:\u002F\u002F…",{"type":49,"value":1738}," URL",{"type":43,"tag":222,"props":1740,"children":1741},{},[1742],{"type":49,"value":1743},"2048 chars",{"type":43,"tag":222,"props":1745,"children":1746},{},[1747],{"type":49,"value":1748},"Image already hosted publicly",{"type":43,"tag":200,"props":1750,"children":1751},{},[1752,1761,1766],{"type":43,"tag":222,"props":1753,"children":1754},{},[1755],{"type":43,"tag":74,"props":1756,"children":1758},{"className":1757},[],[1759],{"type":49,"value":1760},"data:image\u002F…;base64,…",{"type":43,"tag":222,"props":1762,"children":1763},{},[1764],{"type":49,"value":1765},"5 MB (characters)",{"type":43,"tag":222,"props":1767,"children":1768},{},[1769],{"type":49,"value":1770},"Small-to-medium local files (~3.5 MB raw max)",{"type":43,"tag":200,"props":1772,"children":1773},{},[1774,1785,1790],{"type":43,"tag":222,"props":1775,"children":1776},{},[1777,1783],{"type":43,"tag":74,"props":1778,"children":1780},{"className":1779},[],[1781],{"type":49,"value":1782},"runway:\u002F\u002F…",{"type":49,"value":1784}," URI",{"type":43,"tag":222,"props":1786,"children":1787},{},[1788],{"type":49,"value":1789},"5000 chars",{"type":43,"tag":222,"props":1791,"children":1792},{},[1793,1795,1801],{"type":49,"value":1794},"Large files uploaded via ",{"type":43,"tag":74,"props":1796,"children":1798},{"className":1797},[],[1799],{"type":49,"value":1800},"\u002Fv1\u002Fuploads",{"type":49,"value":1802}," first",{"type":43,"tag":44,"props":1804,"children":1806},{"id":1805},"headskillsrw-integrate-charactersskillmdfor-local-files-over-35-mb-use-the-upload-flow-rw-integrate-uploads-to-get-a-runway-uri-instead-of-a-data-uri",[1807,1809,1814,1816,1822],{"type":49,"value":1808},"\u003C\u003C\u003C\u003C\u003C\u003C\u003C HEAD:skills\u002Frw-integrate-characters\u002FSKILL.md\nFor local files over ~3.5 MB, use the upload flow (",{"type":43,"tag":74,"props":1810,"children":1812},{"className":1811},[],[1813],{"type":49,"value":1309},{"type":49,"value":1815},") to get a ",{"type":43,"tag":74,"props":1817,"children":1819},{"className":1818},[],[1820],{"type":49,"value":1821},"runway:\u002F\u002F",{"type":49,"value":1823}," URI instead of a data URI.",{"type":43,"tag":56,"props":1825,"children":1826},{},[1827,1829,1835,1836,1841],{"type":49,"value":1828},"For local files over ~3.5 MB, use the upload flow (",{"type":43,"tag":74,"props":1830,"children":1832},{"className":1831},[],[1833],{"type":49,"value":1834},"+integrate-uploads",{"type":49,"value":1815},{"type":43,"tag":74,"props":1837,"children":1839},{"className":1838},[],[1840],{"type":49,"value":1821},{"type":49,"value":1823},{"type":43,"tag":52,"props":1843,"children":1844},{},[1845],{"type":43,"tag":52,"props":1846,"children":1847},{},[1848],{"type":43,"tag":52,"props":1849,"children":1850},{},[1851],{"type":43,"tag":52,"props":1852,"children":1853},{},[1854],{"type":43,"tag":52,"props":1855,"children":1856},{},[1857],{"type":43,"tag":52,"props":1858,"children":1859},{},[1860],{"type":43,"tag":52,"props":1861,"children":1862},{},[1863],{"type":43,"tag":56,"props":1864,"children":1865},{},[1866],{"type":49,"value":1867},"810dd3a (Improve CLI error details, auth fallback, and skill docs from testing):skills\u002Fintegrate-characters\u002FSKILL.md",{"type":43,"tag":185,"props":1869,"children":1871},{"id":1870},"reference-image-guidelines",[1872],{"type":49,"value":1873},"Reference Image Guidelines",{"type":43,"tag":66,"props":1875,"children":1876},{},[1877,1887,1892,1902,1907],{"type":43,"tag":70,"props":1878,"children":1879},{},[1880,1885],{"type":43,"tag":60,"props":1881,"children":1882},{},[1883],{"type":49,"value":1884},"Any visual style works",{"type":49,"value":1886},": photorealistic humans, animated mascots, stylized brand characters",{"type":43,"tag":70,"props":1888,"children":1889},{},[1890],{"type":49,"value":1891},"Use high-quality images with good lighting",{"type":43,"tag":70,"props":1893,"children":1894},{},[1895,1900],{"type":43,"tag":60,"props":1896,"children":1897},{},[1898],{"type":49,"value":1899},"Face must be clearly visible and centered",{"type":49,"value":1901}," — images without a recognizable face will fail processing",{"type":43,"tag":70,"props":1903,"children":1904},{},[1905],{"type":49,"value":1906},"Avoid images with multiple people or obstructions",{"type":43,"tag":70,"props":1908,"children":1909},{},[1910,1912],{"type":49,"value":1911},"Recommended aspect ratio: ",{"type":43,"tag":60,"props":1913,"children":1914},{},[1915],{"type":49,"value":1916},"1088×704",{"type":43,"tag":185,"props":1918,"children":1920},{"id":1919},"voice-presets",[1921],{"type":49,"value":1922},"Voice Presets",{"type":43,"tag":192,"props":1924,"children":1925},{},[1926,1947],{"type":43,"tag":196,"props":1927,"children":1928},{},[1929],{"type":43,"tag":200,"props":1930,"children":1931},{},[1932,1937,1942],{"type":43,"tag":204,"props":1933,"children":1934},{},[1935],{"type":49,"value":1936},"Preset ID",{"type":43,"tag":204,"props":1938,"children":1939},{},[1940],{"type":49,"value":1941},"Name",{"type":43,"tag":204,"props":1943,"children":1944},{},[1945],{"type":49,"value":1946},"Style",{"type":43,"tag":215,"props":1948,"children":1949},{},[1950,1971,1993],{"type":43,"tag":200,"props":1951,"children":1952},{},[1953,1961,1966],{"type":43,"tag":222,"props":1954,"children":1955},{},[1956],{"type":43,"tag":74,"props":1957,"children":1959},{"className":1958},[],[1960],{"type":49,"value":1030},{"type":43,"tag":222,"props":1962,"children":1963},{},[1964],{"type":49,"value":1965},"Clara",{"type":43,"tag":222,"props":1967,"children":1968},{},[1969],{"type":49,"value":1970},"Soft, approachable",{"type":43,"tag":200,"props":1972,"children":1973},{},[1974,1983,1988],{"type":43,"tag":222,"props":1975,"children":1976},{},[1977],{"type":43,"tag":74,"props":1978,"children":1980},{"className":1979},[],[1981],{"type":49,"value":1982},"victoria",{"type":43,"tag":222,"props":1984,"children":1985},{},[1986],{"type":49,"value":1987},"Victoria",{"type":43,"tag":222,"props":1989,"children":1990},{},[1991],{"type":49,"value":1992},"Firm, professional",{"type":43,"tag":200,"props":1994,"children":1995},{},[1996,2005,2010],{"type":43,"tag":222,"props":1997,"children":1998},{},[1999],{"type":43,"tag":74,"props":2000,"children":2002},{"className":2001},[],[2003],{"type":49,"value":2004},"vincent",{"type":43,"tag":222,"props":2006,"children":2007},{},[2008],{"type":49,"value":2009},"Vincent",{"type":43,"tag":222,"props":2011,"children":2012},{},[2013],{"type":49,"value":2014},"Knowledgeable, authoritative",{"type":43,"tag":56,"props":2016,"children":2017},{},[2018,2020,2025],{"type":49,"value":2019},"Preview all voices in the ",{"type":43,"tag":94,"props":2021,"children":2023},{"href":635,"rel":2022},[98],[2024],{"type":49,"value":606},{"type":49,"value":873},{"type":43,"tag":178,"props":2027,"children":2029},{"id":2028},"step-3-create-a-session-server-side",[2030],{"type":49,"value":2031},"Step 3: Create a Session (Server-Side)",{"type":43,"tag":56,"props":2033,"children":2034},{},[2035,2037,2042],{"type":49,"value":2036},"This is the ",{"type":43,"tag":60,"props":2038,"children":2039},{},[2040],{"type":49,"value":2041},"server-side API route",{"type":49,"value":2043}," that your client will call. It creates a session, polls until ready, consumes credentials, and returns them.",{"type":43,"tag":185,"props":2045,"children":2047},{"id":2046},"nextjs-app-router",[2048],{"type":49,"value":2049},"Next.js App Router",{"type":43,"tag":263,"props":2051,"children":2055},{"className":2052,"code":2053,"language":2054,"meta":271,"style":271},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F app\u002Fapi\u002Favatar\u002Fsession\u002Froute.ts\nimport RunwayML from '@runwayml\u002Fsdk';\n\nconst client = new RunwayML();\n\nexport async function POST(request: Request) {\n  const { avatarId } = await request.json();\n\n  \u002F\u002F 1. Create session\n  const { id: sessionId } = await client.realtimeSessions.create({\n    model: 'gwm1_avatars',\n    avatar: { type: 'custom', avatarId },\n  });\n\n  \u002F\u002F 2. Poll until ready\n  let sessionKey: string | undefined;\n  for (let i = 0; i \u003C 60; i++) {\n    const session = await client.realtimeSessions.retrieve(sessionId);\n\n    if (session.status === 'READY') {\n      sessionKey = session.sessionKey;\n      break;\n    }\n    if (session.status === 'FAILED') {\n      return Response.json({ error: session.failure }, { status: 500 });\n    }\n\n    await new Promise(r => setTimeout(r, 1000));\n  }\n\n  if (!sessionKey) {\n    return Response.json({ error: 'Session timed out' }, { status: 504 });\n  }\n\n  \u002F\u002F 3. Consume session to get WebRTC credentials\n  const consumeResponse = await fetch(\n    `${client.baseURL}\u002Fv1\u002Frealtime_sessions\u002F${sessionId}\u002Fconsume`,\n    {\n      method: 'POST',\n      headers: {\n        Authorization: `Bearer ${sessionKey}`,\n        'X-Runway-Version': '2024-11-06',\n      },\n    }\n  );\n  const credentials = await consumeResponse.json();\n\n  return Response.json({\n    sessionId,\n    serverUrl: credentials.url,\n    token: credentials.token,\n    roomName: credentials.roomName,\n  });\n}\n","typescript",[2056],{"type":43,"tag":74,"props":2057,"children":2058},{"__ignoreMap":271},[2059,2067,2098,2105,2136,2143,2193,2246,2253,2261,2327,2356,2405,2421,2428,2436,2472,2546,2606,2614,2666,2695,2708,2717,2765,2852,2860,2868,2931,2940,2948,2978,3061,3069,3077,3086,3116,3175,3184,3214,3231,3271,3310,3319,3327,3340,3381,3389,3418,3431,3461,3491,3521,3537],{"type":43,"tag":539,"props":2060,"children":2061},{"class":541,"line":542},[2062],{"type":43,"tag":539,"props":2063,"children":2064},{"style":739},[2065],{"type":49,"value":2066},"\u002F\u002F app\u002Fapi\u002Favatar\u002Fsession\u002Froute.ts\n",{"type":43,"tag":539,"props":2068,"children":2069},{"class":541,"line":745},[2070,2074,2078,2082,2086,2090,2094],{"type":43,"tag":539,"props":2071,"children":2072},{"style":749},[2073],{"type":49,"value":752},{"type":43,"tag":539,"props":2075,"children":2076},{"style":755},[2077],{"type":49,"value":758},{"type":43,"tag":539,"props":2079,"children":2080},{"style":749},[2081],{"type":49,"value":763},{"type":43,"tag":539,"props":2083,"children":2084},{"style":766},[2085],{"type":49,"value":769},{"type":43,"tag":539,"props":2087,"children":2088},{"style":552},[2089],{"type":49,"value":577},{"type":43,"tag":539,"props":2091,"children":2092},{"style":766},[2093],{"type":49,"value":778},{"type":43,"tag":539,"props":2095,"children":2096},{"style":766},[2097],{"type":49,"value":783},{"type":43,"tag":539,"props":2099,"children":2100},{"class":541,"line":786},[2101],{"type":43,"tag":539,"props":2102,"children":2103},{"emptyLinePlaceholder":790},[2104],{"type":49,"value":793},{"type":43,"tag":539,"props":2106,"children":2107},{"class":541,"line":796},[2108,2112,2116,2120,2124,2128,2132],{"type":43,"tag":539,"props":2109,"children":2110},{"style":800},[2111],{"type":49,"value":803},{"type":43,"tag":539,"props":2113,"children":2114},{"style":755},[2115],{"type":49,"value":808},{"type":43,"tag":539,"props":2117,"children":2118},{"style":766},[2119],{"type":49,"value":813},{"type":43,"tag":539,"props":2121,"children":2122},{"style":766},[2123],{"type":49,"value":818},{"type":43,"tag":539,"props":2125,"children":2126},{"style":821},[2127],{"type":49,"value":824},{"type":43,"tag":539,"props":2129,"children":2130},{"style":755},[2131],{"type":49,"value":829},{"type":43,"tag":539,"props":2133,"children":2134},{"style":766},[2135],{"type":49,"value":783},{"type":43,"tag":539,"props":2137,"children":2138},{"class":541,"line":836},[2139],{"type":43,"tag":539,"props":2140,"children":2141},{"emptyLinePlaceholder":790},[2142],{"type":49,"value":793},{"type":43,"tag":539,"props":2144,"children":2145},{"class":541,"line":844},[2146,2151,2156,2161,2166,2170,2176,2180,2185,2189],{"type":43,"tag":539,"props":2147,"children":2148},{"style":749},[2149],{"type":49,"value":2150},"export",{"type":43,"tag":539,"props":2152,"children":2153},{"style":800},[2154],{"type":49,"value":2155}," async",{"type":43,"tag":539,"props":2157,"children":2158},{"style":800},[2159],{"type":49,"value":2160}," function",{"type":43,"tag":539,"props":2162,"children":2163},{"style":821},[2164],{"type":49,"value":2165}," POST",{"type":43,"tag":539,"props":2167,"children":2168},{"style":766},[2169],{"type":49,"value":892},{"type":43,"tag":539,"props":2171,"children":2173},{"style":2172},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[2174],{"type":49,"value":2175},"request",{"type":43,"tag":539,"props":2177,"children":2178},{"style":766},[2179],{"type":49,"value":912},{"type":43,"tag":539,"props":2181,"children":2182},{"style":546},[2183],{"type":49,"value":2184}," Request",{"type":43,"tag":539,"props":2186,"children":2187},{"style":766},[2188],{"type":49,"value":481},{"type":43,"tag":539,"props":2190,"children":2191},{"style":766},[2192],{"type":49,"value":978},{"type":43,"tag":539,"props":2194,"children":2195},{"class":541,"line":900},[2196,2201,2205,2210,2215,2220,2224,2229,2233,2238,2242],{"type":43,"tag":539,"props":2197,"children":2198},{"style":800},[2199],{"type":49,"value":2200},"  const",{"type":43,"tag":539,"props":2202,"children":2203},{"style":766},[2204],{"type":49,"value":1579},{"type":43,"tag":539,"props":2206,"children":2207},{"style":755},[2208],{"type":49,"value":2209}," avatarId",{"type":43,"tag":539,"props":2211,"children":2212},{"style":766},[2213],{"type":49,"value":2214}," }",{"type":43,"tag":539,"props":2216,"children":2217},{"style":766},[2218],{"type":49,"value":2219}," =",{"type":43,"tag":539,"props":2221,"children":2222},{"style":749},[2223],{"type":49,"value":863},{"type":43,"tag":539,"props":2225,"children":2226},{"style":755},[2227],{"type":49,"value":2228}," request",{"type":43,"tag":539,"props":2230,"children":2231},{"style":766},[2232],{"type":49,"value":873},{"type":43,"tag":539,"props":2234,"children":2235},{"style":821},[2236],{"type":49,"value":2237},"json",{"type":43,"tag":539,"props":2239,"children":2240},{"style":904},[2241],{"type":49,"value":829},{"type":43,"tag":539,"props":2243,"children":2244},{"style":766},[2245],{"type":49,"value":783},{"type":43,"tag":539,"props":2247,"children":2248},{"class":541,"line":933},[2249],{"type":43,"tag":539,"props":2250,"children":2251},{"emptyLinePlaceholder":790},[2252],{"type":49,"value":793},{"type":43,"tag":539,"props":2254,"children":2255},{"class":541,"line":963},[2256],{"type":43,"tag":539,"props":2257,"children":2258},{"style":739},[2259],{"type":49,"value":2260},"  \u002F\u002F 1. Create session\n",{"type":43,"tag":539,"props":2262,"children":2263},{"class":541,"line":981},[2264,2268,2272,2277,2281,2286,2290,2294,2298,2302,2306,2311,2315,2319,2323],{"type":43,"tag":539,"props":2265,"children":2266},{"style":800},[2267],{"type":49,"value":2200},{"type":43,"tag":539,"props":2269,"children":2270},{"style":766},[2271],{"type":49,"value":1579},{"type":43,"tag":539,"props":2273,"children":2274},{"style":904},[2275],{"type":49,"value":2276}," id",{"type":43,"tag":539,"props":2278,"children":2279},{"style":766},[2280],{"type":49,"value":912},{"type":43,"tag":539,"props":2282,"children":2283},{"style":755},[2284],{"type":49,"value":2285}," sessionId",{"type":43,"tag":539,"props":2287,"children":2288},{"style":766},[2289],{"type":49,"value":2214},{"type":43,"tag":539,"props":2291,"children":2292},{"style":766},[2293],{"type":49,"value":2219},{"type":43,"tag":539,"props":2295,"children":2296},{"style":749},[2297],{"type":49,"value":863},{"type":43,"tag":539,"props":2299,"children":2300},{"style":755},[2301],{"type":49,"value":868},{"type":43,"tag":539,"props":2303,"children":2304},{"style":766},[2305],{"type":49,"value":873},{"type":43,"tag":539,"props":2307,"children":2308},{"style":755},[2309],{"type":49,"value":2310},"realtimeSessions",{"type":43,"tag":539,"props":2312,"children":2313},{"style":766},[2314],{"type":49,"value":873},{"type":43,"tag":539,"props":2316,"children":2317},{"style":821},[2318],{"type":49,"value":887},{"type":43,"tag":539,"props":2320,"children":2321},{"style":904},[2322],{"type":49,"value":892},{"type":43,"tag":539,"props":2324,"children":2325},{"style":766},[2326],{"type":49,"value":897},{"type":43,"tag":539,"props":2328,"children":2329},{"class":541,"line":1011},[2330,2335,2339,2343,2348,2352],{"type":43,"tag":539,"props":2331,"children":2332},{"style":904},[2333],{"type":49,"value":2334},"    model",{"type":43,"tag":539,"props":2336,"children":2337},{"style":766},[2338],{"type":49,"value":912},{"type":43,"tag":539,"props":2340,"children":2341},{"style":766},[2342],{"type":49,"value":769},{"type":43,"tag":539,"props":2344,"children":2345},{"style":552},[2346],{"type":49,"value":2347},"gwm1_avatars",{"type":43,"tag":539,"props":2349,"children":2350},{"style":766},[2351],{"type":49,"value":778},{"type":43,"tag":539,"props":2353,"children":2354},{"style":766},[2355],{"type":49,"value":930},{"type":43,"tag":539,"props":2357,"children":2358},{"class":541,"line":1041},[2359,2364,2368,2372,2376,2380,2384,2389,2393,2397,2401],{"type":43,"tag":539,"props":2360,"children":2361},{"style":904},[2362],{"type":49,"value":2363},"    avatar",{"type":43,"tag":539,"props":2365,"children":2366},{"style":766},[2367],{"type":49,"value":912},{"type":43,"tag":539,"props":2369,"children":2370},{"style":766},[2371],{"type":49,"value":1579},{"type":43,"tag":539,"props":2373,"children":2374},{"style":904},[2375],{"type":49,"value":1584},{"type":43,"tag":539,"props":2377,"children":2378},{"style":766},[2379],{"type":49,"value":912},{"type":43,"tag":539,"props":2381,"children":2382},{"style":766},[2383],{"type":49,"value":769},{"type":43,"tag":539,"props":2385,"children":2386},{"style":552},[2387],{"type":49,"value":2388},"custom",{"type":43,"tag":539,"props":2390,"children":2391},{"style":766},[2392],{"type":49,"value":778},{"type":43,"tag":539,"props":2394,"children":2395},{"style":766},[2396],{"type":49,"value":1141},{"type":43,"tag":539,"props":2398,"children":2399},{"style":755},[2400],{"type":49,"value":2209},{"type":43,"tag":539,"props":2402,"children":2403},{"style":766},[2404],{"type":49,"value":1630},{"type":43,"tag":539,"props":2406,"children":2407},{"class":541,"line":1050},[2408,2413,2417],{"type":43,"tag":539,"props":2409,"children":2410},{"style":766},[2411],{"type":49,"value":2412},"  }",{"type":43,"tag":539,"props":2414,"children":2415},{"style":904},[2416],{"type":49,"value":481},{"type":43,"tag":539,"props":2418,"children":2419},{"style":766},[2420],{"type":49,"value":783},{"type":43,"tag":539,"props":2422,"children":2423},{"class":541,"line":1080},[2424],{"type":43,"tag":539,"props":2425,"children":2426},{"emptyLinePlaceholder":790},[2427],{"type":49,"value":793},{"type":43,"tag":539,"props":2429,"children":2430},{"class":541,"line":28},[2431],{"type":43,"tag":539,"props":2432,"children":2433},{"style":739},[2434],{"type":49,"value":2435},"  \u002F\u002F 2. Poll until ready\n",{"type":43,"tag":539,"props":2437,"children":2438},{"class":541,"line":1104},[2439,2444,2449,2453,2458,2463,2468],{"type":43,"tag":539,"props":2440,"children":2441},{"style":800},[2442],{"type":49,"value":2443},"  let",{"type":43,"tag":539,"props":2445,"children":2446},{"style":755},[2447],{"type":49,"value":2448}," sessionKey",{"type":43,"tag":539,"props":2450,"children":2451},{"style":766},[2452],{"type":49,"value":912},{"type":43,"tag":539,"props":2454,"children":2455},{"style":546},[2456],{"type":49,"value":2457}," string",{"type":43,"tag":539,"props":2459,"children":2460},{"style":766},[2461],{"type":49,"value":2462}," |",{"type":43,"tag":539,"props":2464,"children":2465},{"style":546},[2466],{"type":49,"value":2467}," undefined",{"type":43,"tag":539,"props":2469,"children":2470},{"style":766},[2471],{"type":49,"value":783},{"type":43,"tag":539,"props":2473,"children":2475},{"class":541,"line":2474},17,[2476,2481,2485,2490,2495,2499,2505,2510,2514,2519,2524,2528,2532,2537,2542],{"type":43,"tag":539,"props":2477,"children":2478},{"style":749},[2479],{"type":49,"value":2480},"  for",{"type":43,"tag":539,"props":2482,"children":2483},{"style":904},[2484],{"type":49,"value":493},{"type":43,"tag":539,"props":2486,"children":2487},{"style":800},[2488],{"type":49,"value":2489},"let",{"type":43,"tag":539,"props":2491,"children":2492},{"style":755},[2493],{"type":49,"value":2494}," i",{"type":43,"tag":539,"props":2496,"children":2497},{"style":766},[2498],{"type":49,"value":2219},{"type":43,"tag":539,"props":2500,"children":2502},{"style":2501},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[2503],{"type":49,"value":2504}," 0",{"type":43,"tag":539,"props":2506,"children":2507},{"style":766},[2508],{"type":49,"value":2509},";",{"type":43,"tag":539,"props":2511,"children":2512},{"style":755},[2513],{"type":49,"value":2494},{"type":43,"tag":539,"props":2515,"children":2516},{"style":766},[2517],{"type":49,"value":2518}," \u003C",{"type":43,"tag":539,"props":2520,"children":2521},{"style":2501},[2522],{"type":49,"value":2523}," 60",{"type":43,"tag":539,"props":2525,"children":2526},{"style":766},[2527],{"type":49,"value":2509},{"type":43,"tag":539,"props":2529,"children":2530},{"style":755},[2531],{"type":49,"value":2494},{"type":43,"tag":539,"props":2533,"children":2534},{"style":766},[2535],{"type":49,"value":2536},"++",{"type":43,"tag":539,"props":2538,"children":2539},{"style":904},[2540],{"type":49,"value":2541},") ",{"type":43,"tag":539,"props":2543,"children":2544},{"style":766},[2545],{"type":49,"value":897},{"type":43,"tag":539,"props":2547,"children":2549},{"class":541,"line":2548},18,[2550,2555,2560,2564,2568,2572,2576,2580,2584,2589,2593,2598,2602],{"type":43,"tag":539,"props":2551,"children":2552},{"style":800},[2553],{"type":49,"value":2554},"    const",{"type":43,"tag":539,"props":2556,"children":2557},{"style":755},[2558],{"type":49,"value":2559}," session",{"type":43,"tag":539,"props":2561,"children":2562},{"style":766},[2563],{"type":49,"value":2219},{"type":43,"tag":539,"props":2565,"children":2566},{"style":749},[2567],{"type":49,"value":863},{"type":43,"tag":539,"props":2569,"children":2570},{"style":755},[2571],{"type":49,"value":868},{"type":43,"tag":539,"props":2573,"children":2574},{"style":766},[2575],{"type":49,"value":873},{"type":43,"tag":539,"props":2577,"children":2578},{"style":755},[2579],{"type":49,"value":2310},{"type":43,"tag":539,"props":2581,"children":2582},{"style":766},[2583],{"type":49,"value":873},{"type":43,"tag":539,"props":2585,"children":2586},{"style":821},[2587],{"type":49,"value":2588},"retrieve",{"type":43,"tag":539,"props":2590,"children":2591},{"style":904},[2592],{"type":49,"value":892},{"type":43,"tag":539,"props":2594,"children":2595},{"style":755},[2596],{"type":49,"value":2597},"sessionId",{"type":43,"tag":539,"props":2599,"children":2600},{"style":904},[2601],{"type":49,"value":481},{"type":43,"tag":539,"props":2603,"children":2604},{"style":766},[2605],{"type":49,"value":783},{"type":43,"tag":539,"props":2607,"children":2609},{"class":541,"line":2608},19,[2610],{"type":43,"tag":539,"props":2611,"children":2612},{"emptyLinePlaceholder":790},[2613],{"type":49,"value":793},{"type":43,"tag":539,"props":2615,"children":2617},{"class":541,"line":2616},20,[2618,2623,2627,2632,2636,2641,2646,2650,2654,2658,2662],{"type":43,"tag":539,"props":2619,"children":2620},{"style":749},[2621],{"type":49,"value":2622},"    if",{"type":43,"tag":539,"props":2624,"children":2625},{"style":904},[2626],{"type":49,"value":493},{"type":43,"tag":539,"props":2628,"children":2629},{"style":755},[2630],{"type":49,"value":2631},"session",{"type":43,"tag":539,"props":2633,"children":2634},{"style":766},[2635],{"type":49,"value":873},{"type":43,"tag":539,"props":2637,"children":2638},{"style":755},[2639],{"type":49,"value":2640},"status",{"type":43,"tag":539,"props":2642,"children":2643},{"style":766},[2644],{"type":49,"value":2645}," ===",{"type":43,"tag":539,"props":2647,"children":2648},{"style":766},[2649],{"type":49,"value":769},{"type":43,"tag":539,"props":2651,"children":2652},{"style":552},[2653],{"type":49,"value":323},{"type":43,"tag":539,"props":2655,"children":2656},{"style":766},[2657],{"type":49,"value":778},{"type":43,"tag":539,"props":2659,"children":2660},{"style":904},[2661],{"type":49,"value":2541},{"type":43,"tag":539,"props":2663,"children":2664},{"style":766},[2665],{"type":49,"value":897},{"type":43,"tag":539,"props":2667,"children":2669},{"class":541,"line":2668},21,[2670,2675,2679,2683,2687,2691],{"type":43,"tag":539,"props":2671,"children":2672},{"style":755},[2673],{"type":49,"value":2674},"      sessionKey",{"type":43,"tag":539,"props":2676,"children":2677},{"style":766},[2678],{"type":49,"value":2219},{"type":43,"tag":539,"props":2680,"children":2681},{"style":755},[2682],{"type":49,"value":2559},{"type":43,"tag":539,"props":2684,"children":2685},{"style":766},[2686],{"type":49,"value":873},{"type":43,"tag":539,"props":2688,"children":2689},{"style":755},[2690],{"type":49,"value":334},{"type":43,"tag":539,"props":2692,"children":2693},{"style":766},[2694],{"type":49,"value":783},{"type":43,"tag":539,"props":2696,"children":2698},{"class":541,"line":2697},22,[2699,2704],{"type":43,"tag":539,"props":2700,"children":2701},{"style":749},[2702],{"type":49,"value":2703},"      break",{"type":43,"tag":539,"props":2705,"children":2706},{"style":766},[2707],{"type":49,"value":783},{"type":43,"tag":539,"props":2709,"children":2711},{"class":541,"line":2710},23,[2712],{"type":43,"tag":539,"props":2713,"children":2714},{"style":766},[2715],{"type":49,"value":2716},"    }\n",{"type":43,"tag":539,"props":2718,"children":2720},{"class":541,"line":2719},24,[2721,2725,2729,2733,2737,2741,2745,2749,2753,2757,2761],{"type":43,"tag":539,"props":2722,"children":2723},{"style":749},[2724],{"type":49,"value":2622},{"type":43,"tag":539,"props":2726,"children":2727},{"style":904},[2728],{"type":49,"value":493},{"type":43,"tag":539,"props":2730,"children":2731},{"style":755},[2732],{"type":49,"value":2631},{"type":43,"tag":539,"props":2734,"children":2735},{"style":766},[2736],{"type":49,"value":873},{"type":43,"tag":539,"props":2738,"children":2739},{"style":755},[2740],{"type":49,"value":2640},{"type":43,"tag":539,"props":2742,"children":2743},{"style":766},[2744],{"type":49,"value":2645},{"type":43,"tag":539,"props":2746,"children":2747},{"style":766},[2748],{"type":49,"value":769},{"type":43,"tag":539,"props":2750,"children":2751},{"style":552},[2752],{"type":49,"value":382},{"type":43,"tag":539,"props":2754,"children":2755},{"style":766},[2756],{"type":49,"value":778},{"type":43,"tag":539,"props":2758,"children":2759},{"style":904},[2760],{"type":49,"value":2541},{"type":43,"tag":539,"props":2762,"children":2763},{"style":766},[2764],{"type":49,"value":897},{"type":43,"tag":539,"props":2766,"children":2768},{"class":541,"line":2767},25,[2769,2774,2779,2783,2787,2791,2796,2801,2805,2809,2813,2817,2822,2826,2831,2835,2840,2844,2848],{"type":43,"tag":539,"props":2770,"children":2771},{"style":749},[2772],{"type":49,"value":2773},"      return",{"type":43,"tag":539,"props":2775,"children":2776},{"style":755},[2777],{"type":49,"value":2778}," Response",{"type":43,"tag":539,"props":2780,"children":2781},{"style":766},[2782],{"type":49,"value":873},{"type":43,"tag":539,"props":2784,"children":2785},{"style":821},[2786],{"type":49,"value":2237},{"type":43,"tag":539,"props":2788,"children":2789},{"style":904},[2790],{"type":49,"value":892},{"type":43,"tag":539,"props":2792,"children":2793},{"style":766},[2794],{"type":49,"value":2795},"{",{"type":43,"tag":539,"props":2797,"children":2798},{"style":904},[2799],{"type":49,"value":2800}," error",{"type":43,"tag":539,"props":2802,"children":2803},{"style":766},[2804],{"type":49,"value":912},{"type":43,"tag":539,"props":2806,"children":2807},{"style":755},[2808],{"type":49,"value":2559},{"type":43,"tag":539,"props":2810,"children":2811},{"style":766},[2812],{"type":49,"value":873},{"type":43,"tag":539,"props":2814,"children":2815},{"style":755},[2816],{"type":49,"value":393},{"type":43,"tag":539,"props":2818,"children":2819},{"style":766},[2820],{"type":49,"value":2821}," },",{"type":43,"tag":539,"props":2823,"children":2824},{"style":766},[2825],{"type":49,"value":1579},{"type":43,"tag":539,"props":2827,"children":2828},{"style":904},[2829],{"type":49,"value":2830}," status",{"type":43,"tag":539,"props":2832,"children":2833},{"style":766},[2834],{"type":49,"value":912},{"type":43,"tag":539,"props":2836,"children":2837},{"style":2501},[2838],{"type":49,"value":2839}," 500",{"type":43,"tag":539,"props":2841,"children":2842},{"style":766},[2843],{"type":49,"value":2214},{"type":43,"tag":539,"props":2845,"children":2846},{"style":904},[2847],{"type":49,"value":481},{"type":43,"tag":539,"props":2849,"children":2850},{"style":766},[2851],{"type":49,"value":783},{"type":43,"tag":539,"props":2853,"children":2855},{"class":541,"line":2854},26,[2856],{"type":43,"tag":539,"props":2857,"children":2858},{"style":766},[2859],{"type":49,"value":2716},{"type":43,"tag":539,"props":2861,"children":2863},{"class":541,"line":2862},27,[2864],{"type":43,"tag":539,"props":2865,"children":2866},{"emptyLinePlaceholder":790},[2867],{"type":49,"value":793},{"type":43,"tag":539,"props":2869,"children":2871},{"class":541,"line":2870},28,[2872,2877,2881,2886,2890,2895,2900,2905,2909,2913,2917,2922,2927],{"type":43,"tag":539,"props":2873,"children":2874},{"style":749},[2875],{"type":49,"value":2876},"    await",{"type":43,"tag":539,"props":2878,"children":2879},{"style":766},[2880],{"type":49,"value":818},{"type":43,"tag":539,"props":2882,"children":2883},{"style":546},[2884],{"type":49,"value":2885}," Promise",{"type":43,"tag":539,"props":2887,"children":2888},{"style":904},[2889],{"type":49,"value":892},{"type":43,"tag":539,"props":2891,"children":2892},{"style":2172},[2893],{"type":49,"value":2894},"r",{"type":43,"tag":539,"props":2896,"children":2897},{"style":800},[2898],{"type":49,"value":2899}," =>",{"type":43,"tag":539,"props":2901,"children":2902},{"style":821},[2903],{"type":49,"value":2904}," setTimeout",{"type":43,"tag":539,"props":2906,"children":2907},{"style":904},[2908],{"type":49,"value":892},{"type":43,"tag":539,"props":2910,"children":2911},{"style":755},[2912],{"type":49,"value":2894},{"type":43,"tag":539,"props":2914,"children":2915},{"style":766},[2916],{"type":49,"value":1141},{"type":43,"tag":539,"props":2918,"children":2919},{"style":2501},[2920],{"type":49,"value":2921}," 1000",{"type":43,"tag":539,"props":2923,"children":2924},{"style":904},[2925],{"type":49,"value":2926},"))",{"type":43,"tag":539,"props":2928,"children":2929},{"style":766},[2930],{"type":49,"value":783},{"type":43,"tag":539,"props":2932,"children":2934},{"class":541,"line":2933},29,[2935],{"type":43,"tag":539,"props":2936,"children":2937},{"style":766},[2938],{"type":49,"value":2939},"  }\n",{"type":43,"tag":539,"props":2941,"children":2943},{"class":541,"line":2942},30,[2944],{"type":43,"tag":539,"props":2945,"children":2946},{"emptyLinePlaceholder":790},[2947],{"type":49,"value":793},{"type":43,"tag":539,"props":2949,"children":2951},{"class":541,"line":2950},31,[2952,2957,2961,2966,2970,2974],{"type":43,"tag":539,"props":2953,"children":2954},{"style":749},[2955],{"type":49,"value":2956},"  if",{"type":43,"tag":539,"props":2958,"children":2959},{"style":904},[2960],{"type":49,"value":493},{"type":43,"tag":539,"props":2962,"children":2963},{"style":766},[2964],{"type":49,"value":2965},"!",{"type":43,"tag":539,"props":2967,"children":2968},{"style":755},[2969],{"type":49,"value":334},{"type":43,"tag":539,"props":2971,"children":2972},{"style":904},[2973],{"type":49,"value":2541},{"type":43,"tag":539,"props":2975,"children":2976},{"style":766},[2977],{"type":49,"value":897},{"type":43,"tag":539,"props":2979,"children":2981},{"class":541,"line":2980},32,[2982,2987,2991,2995,2999,3003,3007,3011,3015,3019,3024,3028,3032,3036,3040,3044,3049,3053,3057],{"type":43,"tag":539,"props":2983,"children":2984},{"style":749},[2985],{"type":49,"value":2986},"    return",{"type":43,"tag":539,"props":2988,"children":2989},{"style":755},[2990],{"type":49,"value":2778},{"type":43,"tag":539,"props":2992,"children":2993},{"style":766},[2994],{"type":49,"value":873},{"type":43,"tag":539,"props":2996,"children":2997},{"style":821},[2998],{"type":49,"value":2237},{"type":43,"tag":539,"props":3000,"children":3001},{"style":904},[3002],{"type":49,"value":892},{"type":43,"tag":539,"props":3004,"children":3005},{"style":766},[3006],{"type":49,"value":2795},{"type":43,"tag":539,"props":3008,"children":3009},{"style":904},[3010],{"type":49,"value":2800},{"type":43,"tag":539,"props":3012,"children":3013},{"style":766},[3014],{"type":49,"value":912},{"type":43,"tag":539,"props":3016,"children":3017},{"style":766},[3018],{"type":49,"value":769},{"type":43,"tag":539,"props":3020,"children":3021},{"style":552},[3022],{"type":49,"value":3023},"Session timed out",{"type":43,"tag":539,"props":3025,"children":3026},{"style":766},[3027],{"type":49,"value":778},{"type":43,"tag":539,"props":3029,"children":3030},{"style":766},[3031],{"type":49,"value":2821},{"type":43,"tag":539,"props":3033,"children":3034},{"style":766},[3035],{"type":49,"value":1579},{"type":43,"tag":539,"props":3037,"children":3038},{"style":904},[3039],{"type":49,"value":2830},{"type":43,"tag":539,"props":3041,"children":3042},{"style":766},[3043],{"type":49,"value":912},{"type":43,"tag":539,"props":3045,"children":3046},{"style":2501},[3047],{"type":49,"value":3048}," 504",{"type":43,"tag":539,"props":3050,"children":3051},{"style":766},[3052],{"type":49,"value":2214},{"type":43,"tag":539,"props":3054,"children":3055},{"style":904},[3056],{"type":49,"value":481},{"type":43,"tag":539,"props":3058,"children":3059},{"style":766},[3060],{"type":49,"value":783},{"type":43,"tag":539,"props":3062,"children":3064},{"class":541,"line":3063},33,[3065],{"type":43,"tag":539,"props":3066,"children":3067},{"style":766},[3068],{"type":49,"value":2939},{"type":43,"tag":539,"props":3070,"children":3072},{"class":541,"line":3071},34,[3073],{"type":43,"tag":539,"props":3074,"children":3075},{"emptyLinePlaceholder":790},[3076],{"type":49,"value":793},{"type":43,"tag":539,"props":3078,"children":3080},{"class":541,"line":3079},35,[3081],{"type":43,"tag":539,"props":3082,"children":3083},{"style":739},[3084],{"type":49,"value":3085},"  \u002F\u002F 3. Consume session to get WebRTC credentials\n",{"type":43,"tag":539,"props":3087,"children":3089},{"class":541,"line":3088},36,[3090,3094,3099,3103,3107,3112],{"type":43,"tag":539,"props":3091,"children":3092},{"style":800},[3093],{"type":49,"value":2200},{"type":43,"tag":539,"props":3095,"children":3096},{"style":755},[3097],{"type":49,"value":3098}," consumeResponse",{"type":43,"tag":539,"props":3100,"children":3101},{"style":766},[3102],{"type":49,"value":2219},{"type":43,"tag":539,"props":3104,"children":3105},{"style":749},[3106],{"type":49,"value":863},{"type":43,"tag":539,"props":3108,"children":3109},{"style":821},[3110],{"type":49,"value":3111}," fetch",{"type":43,"tag":539,"props":3113,"children":3114},{"style":904},[3115],{"type":49,"value":1404},{"type":43,"tag":539,"props":3117,"children":3119},{"class":541,"line":3118},37,[3120,3125,3130,3134,3139,3143,3148,3153,3157,3161,3166,3171],{"type":43,"tag":539,"props":3121,"children":3122},{"style":766},[3123],{"type":49,"value":3124},"    `${",{"type":43,"tag":539,"props":3126,"children":3127},{"style":755},[3128],{"type":49,"value":3129},"client",{"type":43,"tag":539,"props":3131,"children":3132},{"style":766},[3133],{"type":49,"value":873},{"type":43,"tag":539,"props":3135,"children":3136},{"style":755},[3137],{"type":49,"value":3138},"baseURL",{"type":43,"tag":539,"props":3140,"children":3141},{"style":766},[3142],{"type":49,"value":1086},{"type":43,"tag":539,"props":3144,"children":3145},{"style":552},[3146],{"type":49,"value":3147},"\u002Fv1\u002Frealtime_sessions\u002F",{"type":43,"tag":539,"props":3149,"children":3150},{"style":766},[3151],{"type":49,"value":3152},"${",{"type":43,"tag":539,"props":3154,"children":3155},{"style":755},[3156],{"type":49,"value":2597},{"type":43,"tag":539,"props":3158,"children":3159},{"style":766},[3160],{"type":49,"value":1086},{"type":43,"tag":539,"props":3162,"children":3163},{"style":552},[3164],{"type":49,"value":3165},"\u002Fconsume",{"type":43,"tag":539,"props":3167,"children":3168},{"style":766},[3169],{"type":49,"value":3170},"`",{"type":43,"tag":539,"props":3172,"children":3173},{"style":766},[3174],{"type":49,"value":930},{"type":43,"tag":539,"props":3176,"children":3178},{"class":541,"line":3177},38,[3179],{"type":43,"tag":539,"props":3180,"children":3181},{"style":766},[3182],{"type":49,"value":3183},"    {\n",{"type":43,"tag":539,"props":3185,"children":3187},{"class":541,"line":3186},39,[3188,3193,3197,3201,3206,3210],{"type":43,"tag":539,"props":3189,"children":3190},{"style":904},[3191],{"type":49,"value":3192},"      method",{"type":43,"tag":539,"props":3194,"children":3195},{"style":766},[3196],{"type":49,"value":912},{"type":43,"tag":539,"props":3198,"children":3199},{"style":766},[3200],{"type":49,"value":769},{"type":43,"tag":539,"props":3202,"children":3203},{"style":552},[3204],{"type":49,"value":3205},"POST",{"type":43,"tag":539,"props":3207,"children":3208},{"style":766},[3209],{"type":49,"value":778},{"type":43,"tag":539,"props":3211,"children":3212},{"style":766},[3213],{"type":49,"value":930},{"type":43,"tag":539,"props":3215,"children":3217},{"class":541,"line":3216},40,[3218,3223,3227],{"type":43,"tag":539,"props":3219,"children":3220},{"style":904},[3221],{"type":49,"value":3222},"      headers",{"type":43,"tag":539,"props":3224,"children":3225},{"style":766},[3226],{"type":49,"value":912},{"type":43,"tag":539,"props":3228,"children":3229},{"style":766},[3230],{"type":49,"value":978},{"type":43,"tag":539,"props":3232,"children":3234},{"class":541,"line":3233},41,[3235,3240,3244,3249,3254,3258,3262,3267],{"type":43,"tag":539,"props":3236,"children":3237},{"style":904},[3238],{"type":49,"value":3239},"        Authorization",{"type":43,"tag":539,"props":3241,"children":3242},{"style":766},[3243],{"type":49,"value":912},{"type":43,"tag":539,"props":3245,"children":3246},{"style":766},[3247],{"type":49,"value":3248}," `",{"type":43,"tag":539,"props":3250,"children":3251},{"style":552},[3252],{"type":49,"value":3253},"Bearer ",{"type":43,"tag":539,"props":3255,"children":3256},{"style":766},[3257],{"type":49,"value":3152},{"type":43,"tag":539,"props":3259,"children":3260},{"style":755},[3261],{"type":49,"value":334},{"type":43,"tag":539,"props":3263,"children":3264},{"style":766},[3265],{"type":49,"value":3266},"}`",{"type":43,"tag":539,"props":3268,"children":3269},{"style":766},[3270],{"type":49,"value":930},{"type":43,"tag":539,"props":3272,"children":3274},{"class":541,"line":3273},42,[3275,3280,3285,3289,3293,3297,3302,3306],{"type":43,"tag":539,"props":3276,"children":3277},{"style":766},[3278],{"type":49,"value":3279},"        '",{"type":43,"tag":539,"props":3281,"children":3282},{"style":904},[3283],{"type":49,"value":3284},"X-Runway-Version",{"type":43,"tag":539,"props":3286,"children":3287},{"style":766},[3288],{"type":49,"value":778},{"type":43,"tag":539,"props":3290,"children":3291},{"style":766},[3292],{"type":49,"value":912},{"type":43,"tag":539,"props":3294,"children":3295},{"style":766},[3296],{"type":49,"value":769},{"type":43,"tag":539,"props":3298,"children":3299},{"style":552},[3300],{"type":49,"value":3301},"2024-11-06",{"type":43,"tag":539,"props":3303,"children":3304},{"style":766},[3305],{"type":49,"value":778},{"type":43,"tag":539,"props":3307,"children":3308},{"style":766},[3309],{"type":49,"value":930},{"type":43,"tag":539,"props":3311,"children":3313},{"class":541,"line":3312},43,[3314],{"type":43,"tag":539,"props":3315,"children":3316},{"style":766},[3317],{"type":49,"value":3318},"      },\n",{"type":43,"tag":539,"props":3320,"children":3322},{"class":541,"line":3321},44,[3323],{"type":43,"tag":539,"props":3324,"children":3325},{"style":766},[3326],{"type":49,"value":2716},{"type":43,"tag":539,"props":3328,"children":3330},{"class":541,"line":3329},45,[3331,3336],{"type":43,"tag":539,"props":3332,"children":3333},{"style":904},[3334],{"type":49,"value":3335},"  )",{"type":43,"tag":539,"props":3337,"children":3338},{"style":766},[3339],{"type":49,"value":783},{"type":43,"tag":539,"props":3341,"children":3343},{"class":541,"line":3342},46,[3344,3348,3353,3357,3361,3365,3369,3373,3377],{"type":43,"tag":539,"props":3345,"children":3346},{"style":800},[3347],{"type":49,"value":2200},{"type":43,"tag":539,"props":3349,"children":3350},{"style":755},[3351],{"type":49,"value":3352}," credentials",{"type":43,"tag":539,"props":3354,"children":3355},{"style":766},[3356],{"type":49,"value":2219},{"type":43,"tag":539,"props":3358,"children":3359},{"style":749},[3360],{"type":49,"value":863},{"type":43,"tag":539,"props":3362,"children":3363},{"style":755},[3364],{"type":49,"value":3098},{"type":43,"tag":539,"props":3366,"children":3367},{"style":766},[3368],{"type":49,"value":873},{"type":43,"tag":539,"props":3370,"children":3371},{"style":821},[3372],{"type":49,"value":2237},{"type":43,"tag":539,"props":3374,"children":3375},{"style":904},[3376],{"type":49,"value":829},{"type":43,"tag":539,"props":3378,"children":3379},{"style":766},[3380],{"type":49,"value":783},{"type":43,"tag":539,"props":3382,"children":3384},{"class":541,"line":3383},47,[3385],{"type":43,"tag":539,"props":3386,"children":3387},{"emptyLinePlaceholder":790},[3388],{"type":49,"value":793},{"type":43,"tag":539,"props":3390,"children":3392},{"class":541,"line":3391},48,[3393,3398,3402,3406,3410,3414],{"type":43,"tag":539,"props":3394,"children":3395},{"style":749},[3396],{"type":49,"value":3397},"  return",{"type":43,"tag":539,"props":3399,"children":3400},{"style":755},[3401],{"type":49,"value":2778},{"type":43,"tag":539,"props":3403,"children":3404},{"style":766},[3405],{"type":49,"value":873},{"type":43,"tag":539,"props":3407,"children":3408},{"style":821},[3409],{"type":49,"value":2237},{"type":43,"tag":539,"props":3411,"children":3412},{"style":904},[3413],{"type":49,"value":892},{"type":43,"tag":539,"props":3415,"children":3416},{"style":766},[3417],{"type":49,"value":897},{"type":43,"tag":539,"props":3419,"children":3421},{"class":541,"line":3420},49,[3422,3427],{"type":43,"tag":539,"props":3423,"children":3424},{"style":755},[3425],{"type":49,"value":3426},"    sessionId",{"type":43,"tag":539,"props":3428,"children":3429},{"style":766},[3430],{"type":49,"value":930},{"type":43,"tag":539,"props":3432,"children":3434},{"class":541,"line":3433},50,[3435,3440,3444,3448,3452,3457],{"type":43,"tag":539,"props":3436,"children":3437},{"style":904},[3438],{"type":49,"value":3439},"    serverUrl",{"type":43,"tag":539,"props":3441,"children":3442},{"style":766},[3443],{"type":49,"value":912},{"type":43,"tag":539,"props":3445,"children":3446},{"style":755},[3447],{"type":49,"value":3352},{"type":43,"tag":539,"props":3449,"children":3450},{"style":766},[3451],{"type":49,"value":873},{"type":43,"tag":539,"props":3453,"children":3454},{"style":755},[3455],{"type":49,"value":3456},"url",{"type":43,"tag":539,"props":3458,"children":3459},{"style":766},[3460],{"type":49,"value":930},{"type":43,"tag":539,"props":3462,"children":3464},{"class":541,"line":3463},51,[3465,3470,3474,3478,3482,3487],{"type":43,"tag":539,"props":3466,"children":3467},{"style":904},[3468],{"type":49,"value":3469},"    token",{"type":43,"tag":539,"props":3471,"children":3472},{"style":766},[3473],{"type":49,"value":912},{"type":43,"tag":539,"props":3475,"children":3476},{"style":755},[3477],{"type":49,"value":3352},{"type":43,"tag":539,"props":3479,"children":3480},{"style":766},[3481],{"type":49,"value":873},{"type":43,"tag":539,"props":3483,"children":3484},{"style":755},[3485],{"type":49,"value":3486},"token",{"type":43,"tag":539,"props":3488,"children":3489},{"style":766},[3490],{"type":49,"value":930},{"type":43,"tag":539,"props":3492,"children":3494},{"class":541,"line":3493},52,[3495,3500,3504,3508,3512,3517],{"type":43,"tag":539,"props":3496,"children":3497},{"style":904},[3498],{"type":49,"value":3499},"    roomName",{"type":43,"tag":539,"props":3501,"children":3502},{"style":766},[3503],{"type":49,"value":912},{"type":43,"tag":539,"props":3505,"children":3506},{"style":755},[3507],{"type":49,"value":3352},{"type":43,"tag":539,"props":3509,"children":3510},{"style":766},[3511],{"type":49,"value":873},{"type":43,"tag":539,"props":3513,"children":3514},{"style":755},[3515],{"type":49,"value":3516},"roomName",{"type":43,"tag":539,"props":3518,"children":3519},{"style":766},[3520],{"type":49,"value":930},{"type":43,"tag":539,"props":3522,"children":3524},{"class":541,"line":3523},53,[3525,3529,3533],{"type":43,"tag":539,"props":3526,"children":3527},{"style":766},[3528],{"type":49,"value":2412},{"type":43,"tag":539,"props":3530,"children":3531},{"style":904},[3532],{"type":49,"value":481},{"type":43,"tag":539,"props":3534,"children":3535},{"style":766},[3536],{"type":49,"value":783},{"type":43,"tag":539,"props":3538,"children":3540},{"class":541,"line":3539},54,[3541],{"type":43,"tag":539,"props":3542,"children":3543},{"style":766},[3544],{"type":49,"value":3545},"}\n",{"type":43,"tag":185,"props":3547,"children":3549},{"id":3548},"expressjs",[3550],{"type":49,"value":3551},"Express.js",{"type":43,"tag":263,"props":3553,"children":3555},{"className":2052,"code":3554,"language":2054,"meta":271,"style":271},"import RunwayML from '@runwayml\u002Fsdk';\nimport express from 'express';\n\nconst client = new RunwayML();\nconst app = express();\napp.use(express.json());\n\napp.post('\u002Fapi\u002Favatar\u002Fsession', async (req, res) => {\n  const { avatarId } = req.body;\n\n  try {\n    \u002F\u002F 1. Create session\n    const { id: sessionId } = await client.realtimeSessions.create({\n      model: 'gwm1_avatars',\n      avatar: { type: 'custom', avatarId },\n    });\n\n    \u002F\u002F 2. Poll until ready\n    let sessionKey: string | undefined;\n    for (let i = 0; i \u003C 60; i++) {\n      const session = await client.realtimeSessions.retrieve(sessionId);\n\n      if (session.status === 'READY') {\n        sessionKey = session.sessionKey;\n        break;\n      }\n      if (session.status === 'FAILED') {\n        return res.status(500).json({ error: session.failure });\n      }\n\n      await new Promise(r => setTimeout(r, 1000));\n    }\n\n    if (!sessionKey) {\n      return res.status(504).json({ error: 'Session timed out' });\n    }\n\n    \u002F\u002F 3. Consume credentials\n    const consumeResponse = await fetch(\n      `${client.baseURL}\u002Fv1\u002Frealtime_sessions\u002F${sessionId}\u002Fconsume`,\n      {\n        method: 'POST',\n        headers: {\n          Authorization: `Bearer ${sessionKey}`,\n          'X-Runway-Version': '2024-11-06',\n        },\n      }\n    );\n    const credentials = await consumeResponse.json();\n\n    res.json({\n      sessionId,\n      serverUrl: credentials.url,\n      token: credentials.token,\n      roomName: credentials.roomName,\n    });\n  } catch (error) {\n    console.error('Session creation failed:', error);\n    res.status(500).json({ error: error instanceof Error ? error.message : 'Unknown error' });\n  }\n});\n",[3556],{"type":43,"tag":74,"props":3557,"children":3558},{"__ignoreMap":271},[3559,3590,3623,3630,3661,3690,3729,3736,3807,3848,3855,3867,3875,3938,3966,4014,4030,4037,4045,4077,4141,4197,4204,4252,4280,4292,4300,4347,4428,4435,4442,4498,4505,4512,4539,4619,4626,4633,4641,4668,4720,4728,4756,4772,4808,4844,4852,4859,4871,4910,4917,4941,4953,4981,5009,5038,5054,5083,5133,5247,5255],{"type":43,"tag":539,"props":3560,"children":3561},{"class":541,"line":542},[3562,3566,3570,3574,3578,3582,3586],{"type":43,"tag":539,"props":3563,"children":3564},{"style":749},[3565],{"type":49,"value":752},{"type":43,"tag":539,"props":3567,"children":3568},{"style":755},[3569],{"type":49,"value":758},{"type":43,"tag":539,"props":3571,"children":3572},{"style":749},[3573],{"type":49,"value":763},{"type":43,"tag":539,"props":3575,"children":3576},{"style":766},[3577],{"type":49,"value":769},{"type":43,"tag":539,"props":3579,"children":3580},{"style":552},[3581],{"type":49,"value":577},{"type":43,"tag":539,"props":3583,"children":3584},{"style":766},[3585],{"type":49,"value":778},{"type":43,"tag":539,"props":3587,"children":3588},{"style":766},[3589],{"type":49,"value":783},{"type":43,"tag":539,"props":3591,"children":3592},{"class":541,"line":745},[3593,3597,3602,3606,3610,3615,3619],{"type":43,"tag":539,"props":3594,"children":3595},{"style":749},[3596],{"type":49,"value":752},{"type":43,"tag":539,"props":3598,"children":3599},{"style":755},[3600],{"type":49,"value":3601}," express ",{"type":43,"tag":539,"props":3603,"children":3604},{"style":749},[3605],{"type":49,"value":763},{"type":43,"tag":539,"props":3607,"children":3608},{"style":766},[3609],{"type":49,"value":769},{"type":43,"tag":539,"props":3611,"children":3612},{"style":552},[3613],{"type":49,"value":3614},"express",{"type":43,"tag":539,"props":3616,"children":3617},{"style":766},[3618],{"type":49,"value":778},{"type":43,"tag":539,"props":3620,"children":3621},{"style":766},[3622],{"type":49,"value":783},{"type":43,"tag":539,"props":3624,"children":3625},{"class":541,"line":786},[3626],{"type":43,"tag":539,"props":3627,"children":3628},{"emptyLinePlaceholder":790},[3629],{"type":49,"value":793},{"type":43,"tag":539,"props":3631,"children":3632},{"class":541,"line":796},[3633,3637,3641,3645,3649,3653,3657],{"type":43,"tag":539,"props":3634,"children":3635},{"style":800},[3636],{"type":49,"value":803},{"type":43,"tag":539,"props":3638,"children":3639},{"style":755},[3640],{"type":49,"value":808},{"type":43,"tag":539,"props":3642,"children":3643},{"style":766},[3644],{"type":49,"value":813},{"type":43,"tag":539,"props":3646,"children":3647},{"style":766},[3648],{"type":49,"value":818},{"type":43,"tag":539,"props":3650,"children":3651},{"style":821},[3652],{"type":49,"value":824},{"type":43,"tag":539,"props":3654,"children":3655},{"style":755},[3656],{"type":49,"value":829},{"type":43,"tag":539,"props":3658,"children":3659},{"style":766},[3660],{"type":49,"value":783},{"type":43,"tag":539,"props":3662,"children":3663},{"class":541,"line":836},[3664,3668,3673,3677,3682,3686],{"type":43,"tag":539,"props":3665,"children":3666},{"style":800},[3667],{"type":49,"value":803},{"type":43,"tag":539,"props":3669,"children":3670},{"style":755},[3671],{"type":49,"value":3672}," app ",{"type":43,"tag":539,"props":3674,"children":3675},{"style":766},[3676],{"type":49,"value":813},{"type":43,"tag":539,"props":3678,"children":3679},{"style":821},[3680],{"type":49,"value":3681}," express",{"type":43,"tag":539,"props":3683,"children":3684},{"style":755},[3685],{"type":49,"value":829},{"type":43,"tag":539,"props":3687,"children":3688},{"style":766},[3689],{"type":49,"value":783},{"type":43,"tag":539,"props":3691,"children":3692},{"class":541,"line":844},[3693,3698,3702,3707,3712,3716,3720,3725],{"type":43,"tag":539,"props":3694,"children":3695},{"style":755},[3696],{"type":49,"value":3697},"app",{"type":43,"tag":539,"props":3699,"children":3700},{"style":766},[3701],{"type":49,"value":873},{"type":43,"tag":539,"props":3703,"children":3704},{"style":821},[3705],{"type":49,"value":3706},"use",{"type":43,"tag":539,"props":3708,"children":3709},{"style":755},[3710],{"type":49,"value":3711},"(express",{"type":43,"tag":539,"props":3713,"children":3714},{"style":766},[3715],{"type":49,"value":873},{"type":43,"tag":539,"props":3717,"children":3718},{"style":821},[3719],{"type":49,"value":2237},{"type":43,"tag":539,"props":3721,"children":3722},{"style":755},[3723],{"type":49,"value":3724},"())",{"type":43,"tag":539,"props":3726,"children":3727},{"style":766},[3728],{"type":49,"value":783},{"type":43,"tag":539,"props":3730,"children":3731},{"class":541,"line":900},[3732],{"type":43,"tag":539,"props":3733,"children":3734},{"emptyLinePlaceholder":790},[3735],{"type":49,"value":793},{"type":43,"tag":539,"props":3737,"children":3738},{"class":541,"line":933},[3739,3743,3747,3752,3756,3760,3765,3769,3773,3777,3781,3786,3790,3795,3799,3803],{"type":43,"tag":539,"props":3740,"children":3741},{"style":755},[3742],{"type":49,"value":3697},{"type":43,"tag":539,"props":3744,"children":3745},{"style":766},[3746],{"type":49,"value":873},{"type":43,"tag":539,"props":3748,"children":3749},{"style":821},[3750],{"type":49,"value":3751},"post",{"type":43,"tag":539,"props":3753,"children":3754},{"style":755},[3755],{"type":49,"value":892},{"type":43,"tag":539,"props":3757,"children":3758},{"style":766},[3759],{"type":49,"value":778},{"type":43,"tag":539,"props":3761,"children":3762},{"style":552},[3763],{"type":49,"value":3764},"\u002Fapi\u002Favatar\u002Fsession",{"type":43,"tag":539,"props":3766,"children":3767},{"style":766},[3768],{"type":49,"value":778},{"type":43,"tag":539,"props":3770,"children":3771},{"style":766},[3772],{"type":49,"value":1141},{"type":43,"tag":539,"props":3774,"children":3775},{"style":800},[3776],{"type":49,"value":2155},{"type":43,"tag":539,"props":3778,"children":3779},{"style":766},[3780],{"type":49,"value":493},{"type":43,"tag":539,"props":3782,"children":3783},{"style":2172},[3784],{"type":49,"value":3785},"req",{"type":43,"tag":539,"props":3787,"children":3788},{"style":766},[3789],{"type":49,"value":1141},{"type":43,"tag":539,"props":3791,"children":3792},{"style":2172},[3793],{"type":49,"value":3794}," res",{"type":43,"tag":539,"props":3796,"children":3797},{"style":766},[3798],{"type":49,"value":481},{"type":43,"tag":539,"props":3800,"children":3801},{"style":800},[3802],{"type":49,"value":2899},{"type":43,"tag":539,"props":3804,"children":3805},{"style":766},[3806],{"type":49,"value":978},{"type":43,"tag":539,"props":3808,"children":3809},{"class":541,"line":963},[3810,3814,3818,3822,3826,3830,3835,3839,3844],{"type":43,"tag":539,"props":3811,"children":3812},{"style":800},[3813],{"type":49,"value":2200},{"type":43,"tag":539,"props":3815,"children":3816},{"style":766},[3817],{"type":49,"value":1579},{"type":43,"tag":539,"props":3819,"children":3820},{"style":755},[3821],{"type":49,"value":2209},{"type":43,"tag":539,"props":3823,"children":3824},{"style":766},[3825],{"type":49,"value":2214},{"type":43,"tag":539,"props":3827,"children":3828},{"style":766},[3829],{"type":49,"value":2219},{"type":43,"tag":539,"props":3831,"children":3832},{"style":755},[3833],{"type":49,"value":3834}," req",{"type":43,"tag":539,"props":3836,"children":3837},{"style":766},[3838],{"type":49,"value":873},{"type":43,"tag":539,"props":3840,"children":3841},{"style":755},[3842],{"type":49,"value":3843},"body",{"type":43,"tag":539,"props":3845,"children":3846},{"style":766},[3847],{"type":49,"value":783},{"type":43,"tag":539,"props":3849,"children":3850},{"class":541,"line":981},[3851],{"type":43,"tag":539,"props":3852,"children":3853},{"emptyLinePlaceholder":790},[3854],{"type":49,"value":793},{"type":43,"tag":539,"props":3856,"children":3857},{"class":541,"line":1011},[3858,3863],{"type":43,"tag":539,"props":3859,"children":3860},{"style":749},[3861],{"type":49,"value":3862},"  try",{"type":43,"tag":539,"props":3864,"children":3865},{"style":766},[3866],{"type":49,"value":978},{"type":43,"tag":539,"props":3868,"children":3869},{"class":541,"line":1041},[3870],{"type":43,"tag":539,"props":3871,"children":3872},{"style":739},[3873],{"type":49,"value":3874},"    \u002F\u002F 1. Create session\n",{"type":43,"tag":539,"props":3876,"children":3877},{"class":541,"line":1050},[3878,3882,3886,3890,3894,3898,3902,3906,3910,3914,3918,3922,3926,3930,3934],{"type":43,"tag":539,"props":3879,"children":3880},{"style":800},[3881],{"type":49,"value":2554},{"type":43,"tag":539,"props":3883,"children":3884},{"style":766},[3885],{"type":49,"value":1579},{"type":43,"tag":539,"props":3887,"children":3888},{"style":904},[3889],{"type":49,"value":2276},{"type":43,"tag":539,"props":3891,"children":3892},{"style":766},[3893],{"type":49,"value":912},{"type":43,"tag":539,"props":3895,"children":3896},{"style":755},[3897],{"type":49,"value":2285},{"type":43,"tag":539,"props":3899,"children":3900},{"style":766},[3901],{"type":49,"value":2214},{"type":43,"tag":539,"props":3903,"children":3904},{"style":766},[3905],{"type":49,"value":2219},{"type":43,"tag":539,"props":3907,"children":3908},{"style":749},[3909],{"type":49,"value":863},{"type":43,"tag":539,"props":3911,"children":3912},{"style":755},[3913],{"type":49,"value":868},{"type":43,"tag":539,"props":3915,"children":3916},{"style":766},[3917],{"type":49,"value":873},{"type":43,"tag":539,"props":3919,"children":3920},{"style":755},[3921],{"type":49,"value":2310},{"type":43,"tag":539,"props":3923,"children":3924},{"style":766},[3925],{"type":49,"value":873},{"type":43,"tag":539,"props":3927,"children":3928},{"style":821},[3929],{"type":49,"value":887},{"type":43,"tag":539,"props":3931,"children":3932},{"style":904},[3933],{"type":49,"value":892},{"type":43,"tag":539,"props":3935,"children":3936},{"style":766},[3937],{"type":49,"value":897},{"type":43,"tag":539,"props":3939,"children":3940},{"class":541,"line":1080},[3941,3946,3950,3954,3958,3962],{"type":43,"tag":539,"props":3942,"children":3943},{"style":904},[3944],{"type":49,"value":3945},"      model",{"type":43,"tag":539,"props":3947,"children":3948},{"style":766},[3949],{"type":49,"value":912},{"type":43,"tag":539,"props":3951,"children":3952},{"style":766},[3953],{"type":49,"value":769},{"type":43,"tag":539,"props":3955,"children":3956},{"style":552},[3957],{"type":49,"value":2347},{"type":43,"tag":539,"props":3959,"children":3960},{"style":766},[3961],{"type":49,"value":778},{"type":43,"tag":539,"props":3963,"children":3964},{"style":766},[3965],{"type":49,"value":930},{"type":43,"tag":539,"props":3967,"children":3968},{"class":541,"line":28},[3969,3974,3978,3982,3986,3990,3994,3998,4002,4006,4010],{"type":43,"tag":539,"props":3970,"children":3971},{"style":904},[3972],{"type":49,"value":3973},"      avatar",{"type":43,"tag":539,"props":3975,"children":3976},{"style":766},[3977],{"type":49,"value":912},{"type":43,"tag":539,"props":3979,"children":3980},{"style":766},[3981],{"type":49,"value":1579},{"type":43,"tag":539,"props":3983,"children":3984},{"style":904},[3985],{"type":49,"value":1584},{"type":43,"tag":539,"props":3987,"children":3988},{"style":766},[3989],{"type":49,"value":912},{"type":43,"tag":539,"props":3991,"children":3992},{"style":766},[3993],{"type":49,"value":769},{"type":43,"tag":539,"props":3995,"children":3996},{"style":552},[3997],{"type":49,"value":2388},{"type":43,"tag":539,"props":3999,"children":4000},{"style":766},[4001],{"type":49,"value":778},{"type":43,"tag":539,"props":4003,"children":4004},{"style":766},[4005],{"type":49,"value":1141},{"type":43,"tag":539,"props":4007,"children":4008},{"style":755},[4009],{"type":49,"value":2209},{"type":43,"tag":539,"props":4011,"children":4012},{"style":766},[4013],{"type":49,"value":1630},{"type":43,"tag":539,"props":4015,"children":4016},{"class":541,"line":1104},[4017,4022,4026],{"type":43,"tag":539,"props":4018,"children":4019},{"style":766},[4020],{"type":49,"value":4021},"    }",{"type":43,"tag":539,"props":4023,"children":4024},{"style":904},[4025],{"type":49,"value":481},{"type":43,"tag":539,"props":4027,"children":4028},{"style":766},[4029],{"type":49,"value":783},{"type":43,"tag":539,"props":4031,"children":4032},{"class":541,"line":2474},[4033],{"type":43,"tag":539,"props":4034,"children":4035},{"emptyLinePlaceholder":790},[4036],{"type":49,"value":793},{"type":43,"tag":539,"props":4038,"children":4039},{"class":541,"line":2548},[4040],{"type":43,"tag":539,"props":4041,"children":4042},{"style":739},[4043],{"type":49,"value":4044},"    \u002F\u002F 2. Poll until ready\n",{"type":43,"tag":539,"props":4046,"children":4047},{"class":541,"line":2608},[4048,4053,4057,4061,4065,4069,4073],{"type":43,"tag":539,"props":4049,"children":4050},{"style":800},[4051],{"type":49,"value":4052},"    let",{"type":43,"tag":539,"props":4054,"children":4055},{"style":755},[4056],{"type":49,"value":2448},{"type":43,"tag":539,"props":4058,"children":4059},{"style":766},[4060],{"type":49,"value":912},{"type":43,"tag":539,"props":4062,"children":4063},{"style":546},[4064],{"type":49,"value":2457},{"type":43,"tag":539,"props":4066,"children":4067},{"style":766},[4068],{"type":49,"value":2462},{"type":43,"tag":539,"props":4070,"children":4071},{"style":546},[4072],{"type":49,"value":2467},{"type":43,"tag":539,"props":4074,"children":4075},{"style":766},[4076],{"type":49,"value":783},{"type":43,"tag":539,"props":4078,"children":4079},{"class":541,"line":2616},[4080,4085,4089,4093,4097,4101,4105,4109,4113,4117,4121,4125,4129,4133,4137],{"type":43,"tag":539,"props":4081,"children":4082},{"style":749},[4083],{"type":49,"value":4084},"    for",{"type":43,"tag":539,"props":4086,"children":4087},{"style":904},[4088],{"type":49,"value":493},{"type":43,"tag":539,"props":4090,"children":4091},{"style":800},[4092],{"type":49,"value":2489},{"type":43,"tag":539,"props":4094,"children":4095},{"style":755},[4096],{"type":49,"value":2494},{"type":43,"tag":539,"props":4098,"children":4099},{"style":766},[4100],{"type":49,"value":2219},{"type":43,"tag":539,"props":4102,"children":4103},{"style":2501},[4104],{"type":49,"value":2504},{"type":43,"tag":539,"props":4106,"children":4107},{"style":766},[4108],{"type":49,"value":2509},{"type":43,"tag":539,"props":4110,"children":4111},{"style":755},[4112],{"type":49,"value":2494},{"type":43,"tag":539,"props":4114,"children":4115},{"style":766},[4116],{"type":49,"value":2518},{"type":43,"tag":539,"props":4118,"children":4119},{"style":2501},[4120],{"type":49,"value":2523},{"type":43,"tag":539,"props":4122,"children":4123},{"style":766},[4124],{"type":49,"value":2509},{"type":43,"tag":539,"props":4126,"children":4127},{"style":755},[4128],{"type":49,"value":2494},{"type":43,"tag":539,"props":4130,"children":4131},{"style":766},[4132],{"type":49,"value":2536},{"type":43,"tag":539,"props":4134,"children":4135},{"style":904},[4136],{"type":49,"value":2541},{"type":43,"tag":539,"props":4138,"children":4139},{"style":766},[4140],{"type":49,"value":897},{"type":43,"tag":539,"props":4142,"children":4143},{"class":541,"line":2668},[4144,4149,4153,4157,4161,4165,4169,4173,4177,4181,4185,4189,4193],{"type":43,"tag":539,"props":4145,"children":4146},{"style":800},[4147],{"type":49,"value":4148},"      const",{"type":43,"tag":539,"props":4150,"children":4151},{"style":755},[4152],{"type":49,"value":2559},{"type":43,"tag":539,"props":4154,"children":4155},{"style":766},[4156],{"type":49,"value":2219},{"type":43,"tag":539,"props":4158,"children":4159},{"style":749},[4160],{"type":49,"value":863},{"type":43,"tag":539,"props":4162,"children":4163},{"style":755},[4164],{"type":49,"value":868},{"type":43,"tag":539,"props":4166,"children":4167},{"style":766},[4168],{"type":49,"value":873},{"type":43,"tag":539,"props":4170,"children":4171},{"style":755},[4172],{"type":49,"value":2310},{"type":43,"tag":539,"props":4174,"children":4175},{"style":766},[4176],{"type":49,"value":873},{"type":43,"tag":539,"props":4178,"children":4179},{"style":821},[4180],{"type":49,"value":2588},{"type":43,"tag":539,"props":4182,"children":4183},{"style":904},[4184],{"type":49,"value":892},{"type":43,"tag":539,"props":4186,"children":4187},{"style":755},[4188],{"type":49,"value":2597},{"type":43,"tag":539,"props":4190,"children":4191},{"style":904},[4192],{"type":49,"value":481},{"type":43,"tag":539,"props":4194,"children":4195},{"style":766},[4196],{"type":49,"value":783},{"type":43,"tag":539,"props":4198,"children":4199},{"class":541,"line":2697},[4200],{"type":43,"tag":539,"props":4201,"children":4202},{"emptyLinePlaceholder":790},[4203],{"type":49,"value":793},{"type":43,"tag":539,"props":4205,"children":4206},{"class":541,"line":2710},[4207,4212,4216,4220,4224,4228,4232,4236,4240,4244,4248],{"type":43,"tag":539,"props":4208,"children":4209},{"style":749},[4210],{"type":49,"value":4211},"      if",{"type":43,"tag":539,"props":4213,"children":4214},{"style":904},[4215],{"type":49,"value":493},{"type":43,"tag":539,"props":4217,"children":4218},{"style":755},[4219],{"type":49,"value":2631},{"type":43,"tag":539,"props":4221,"children":4222},{"style":766},[4223],{"type":49,"value":873},{"type":43,"tag":539,"props":4225,"children":4226},{"style":755},[4227],{"type":49,"value":2640},{"type":43,"tag":539,"props":4229,"children":4230},{"style":766},[4231],{"type":49,"value":2645},{"type":43,"tag":539,"props":4233,"children":4234},{"style":766},[4235],{"type":49,"value":769},{"type":43,"tag":539,"props":4237,"children":4238},{"style":552},[4239],{"type":49,"value":323},{"type":43,"tag":539,"props":4241,"children":4242},{"style":766},[4243],{"type":49,"value":778},{"type":43,"tag":539,"props":4245,"children":4246},{"style":904},[4247],{"type":49,"value":2541},{"type":43,"tag":539,"props":4249,"children":4250},{"style":766},[4251],{"type":49,"value":897},{"type":43,"tag":539,"props":4253,"children":4254},{"class":541,"line":2719},[4255,4260,4264,4268,4272,4276],{"type":43,"tag":539,"props":4256,"children":4257},{"style":755},[4258],{"type":49,"value":4259},"        sessionKey",{"type":43,"tag":539,"props":4261,"children":4262},{"style":766},[4263],{"type":49,"value":2219},{"type":43,"tag":539,"props":4265,"children":4266},{"style":755},[4267],{"type":49,"value":2559},{"type":43,"tag":539,"props":4269,"children":4270},{"style":766},[4271],{"type":49,"value":873},{"type":43,"tag":539,"props":4273,"children":4274},{"style":755},[4275],{"type":49,"value":334},{"type":43,"tag":539,"props":4277,"children":4278},{"style":766},[4279],{"type":49,"value":783},{"type":43,"tag":539,"props":4281,"children":4282},{"class":541,"line":2767},[4283,4288],{"type":43,"tag":539,"props":4284,"children":4285},{"style":749},[4286],{"type":49,"value":4287},"        break",{"type":43,"tag":539,"props":4289,"children":4290},{"style":766},[4291],{"type":49,"value":783},{"type":43,"tag":539,"props":4293,"children":4294},{"class":541,"line":2854},[4295],{"type":43,"tag":539,"props":4296,"children":4297},{"style":766},[4298],{"type":49,"value":4299},"      }\n",{"type":43,"tag":539,"props":4301,"children":4302},{"class":541,"line":2862},[4303,4307,4311,4315,4319,4323,4327,4331,4335,4339,4343],{"type":43,"tag":539,"props":4304,"children":4305},{"style":749},[4306],{"type":49,"value":4211},{"type":43,"tag":539,"props":4308,"children":4309},{"style":904},[4310],{"type":49,"value":493},{"type":43,"tag":539,"props":4312,"children":4313},{"style":755},[4314],{"type":49,"value":2631},{"type":43,"tag":539,"props":4316,"children":4317},{"style":766},[4318],{"type":49,"value":873},{"type":43,"tag":539,"props":4320,"children":4321},{"style":755},[4322],{"type":49,"value":2640},{"type":43,"tag":539,"props":4324,"children":4325},{"style":766},[4326],{"type":49,"value":2645},{"type":43,"tag":539,"props":4328,"children":4329},{"style":766},[4330],{"type":49,"value":769},{"type":43,"tag":539,"props":4332,"children":4333},{"style":552},[4334],{"type":49,"value":382},{"type":43,"tag":539,"props":4336,"children":4337},{"style":766},[4338],{"type":49,"value":778},{"type":43,"tag":539,"props":4340,"children":4341},{"style":904},[4342],{"type":49,"value":2541},{"type":43,"tag":539,"props":4344,"children":4345},{"style":766},[4346],{"type":49,"value":897},{"type":43,"tag":539,"props":4348,"children":4349},{"class":541,"line":2870},[4350,4355,4359,4363,4367,4371,4376,4380,4384,4388,4392,4396,4400,4404,4408,4412,4416,4420,4424],{"type":43,"tag":539,"props":4351,"children":4352},{"style":749},[4353],{"type":49,"value":4354},"        return",{"type":43,"tag":539,"props":4356,"children":4357},{"style":755},[4358],{"type":49,"value":3794},{"type":43,"tag":539,"props":4360,"children":4361},{"style":766},[4362],{"type":49,"value":873},{"type":43,"tag":539,"props":4364,"children":4365},{"style":821},[4366],{"type":49,"value":2640},{"type":43,"tag":539,"props":4368,"children":4369},{"style":904},[4370],{"type":49,"value":892},{"type":43,"tag":539,"props":4372,"children":4373},{"style":2501},[4374],{"type":49,"value":4375},"500",{"type":43,"tag":539,"props":4377,"children":4378},{"style":904},[4379],{"type":49,"value":481},{"type":43,"tag":539,"props":4381,"children":4382},{"style":766},[4383],{"type":49,"value":873},{"type":43,"tag":539,"props":4385,"children":4386},{"style":821},[4387],{"type":49,"value":2237},{"type":43,"tag":539,"props":4389,"children":4390},{"style":904},[4391],{"type":49,"value":892},{"type":43,"tag":539,"props":4393,"children":4394},{"style":766},[4395],{"type":49,"value":2795},{"type":43,"tag":539,"props":4397,"children":4398},{"style":904},[4399],{"type":49,"value":2800},{"type":43,"tag":539,"props":4401,"children":4402},{"style":766},[4403],{"type":49,"value":912},{"type":43,"tag":539,"props":4405,"children":4406},{"style":755},[4407],{"type":49,"value":2559},{"type":43,"tag":539,"props":4409,"children":4410},{"style":766},[4411],{"type":49,"value":873},{"type":43,"tag":539,"props":4413,"children":4414},{"style":755},[4415],{"type":49,"value":393},{"type":43,"tag":539,"props":4417,"children":4418},{"style":766},[4419],{"type":49,"value":2214},{"type":43,"tag":539,"props":4421,"children":4422},{"style":904},[4423],{"type":49,"value":481},{"type":43,"tag":539,"props":4425,"children":4426},{"style":766},[4427],{"type":49,"value":783},{"type":43,"tag":539,"props":4429,"children":4430},{"class":541,"line":2933},[4431],{"type":43,"tag":539,"props":4432,"children":4433},{"style":766},[4434],{"type":49,"value":4299},{"type":43,"tag":539,"props":4436,"children":4437},{"class":541,"line":2942},[4438],{"type":43,"tag":539,"props":4439,"children":4440},{"emptyLinePlaceholder":790},[4441],{"type":49,"value":793},{"type":43,"tag":539,"props":4443,"children":4444},{"class":541,"line":2950},[4445,4450,4454,4458,4462,4466,4470,4474,4478,4482,4486,4490,4494],{"type":43,"tag":539,"props":4446,"children":4447},{"style":749},[4448],{"type":49,"value":4449},"      await",{"type":43,"tag":539,"props":4451,"children":4452},{"style":766},[4453],{"type":49,"value":818},{"type":43,"tag":539,"props":4455,"children":4456},{"style":546},[4457],{"type":49,"value":2885},{"type":43,"tag":539,"props":4459,"children":4460},{"style":904},[4461],{"type":49,"value":892},{"type":43,"tag":539,"props":4463,"children":4464},{"style":2172},[4465],{"type":49,"value":2894},{"type":43,"tag":539,"props":4467,"children":4468},{"style":800},[4469],{"type":49,"value":2899},{"type":43,"tag":539,"props":4471,"children":4472},{"style":821},[4473],{"type":49,"value":2904},{"type":43,"tag":539,"props":4475,"children":4476},{"style":904},[4477],{"type":49,"value":892},{"type":43,"tag":539,"props":4479,"children":4480},{"style":755},[4481],{"type":49,"value":2894},{"type":43,"tag":539,"props":4483,"children":4484},{"style":766},[4485],{"type":49,"value":1141},{"type":43,"tag":539,"props":4487,"children":4488},{"style":2501},[4489],{"type":49,"value":2921},{"type":43,"tag":539,"props":4491,"children":4492},{"style":904},[4493],{"type":49,"value":2926},{"type":43,"tag":539,"props":4495,"children":4496},{"style":766},[4497],{"type":49,"value":783},{"type":43,"tag":539,"props":4499,"children":4500},{"class":541,"line":2980},[4501],{"type":43,"tag":539,"props":4502,"children":4503},{"style":766},[4504],{"type":49,"value":2716},{"type":43,"tag":539,"props":4506,"children":4507},{"class":541,"line":3063},[4508],{"type":43,"tag":539,"props":4509,"children":4510},{"emptyLinePlaceholder":790},[4511],{"type":49,"value":793},{"type":43,"tag":539,"props":4513,"children":4514},{"class":541,"line":3071},[4515,4519,4523,4527,4531,4535],{"type":43,"tag":539,"props":4516,"children":4517},{"style":749},[4518],{"type":49,"value":2622},{"type":43,"tag":539,"props":4520,"children":4521},{"style":904},[4522],{"type":49,"value":493},{"type":43,"tag":539,"props":4524,"children":4525},{"style":766},[4526],{"type":49,"value":2965},{"type":43,"tag":539,"props":4528,"children":4529},{"style":755},[4530],{"type":49,"value":334},{"type":43,"tag":539,"props":4532,"children":4533},{"style":904},[4534],{"type":49,"value":2541},{"type":43,"tag":539,"props":4536,"children":4537},{"style":766},[4538],{"type":49,"value":897},{"type":43,"tag":539,"props":4540,"children":4541},{"class":541,"line":3079},[4542,4546,4550,4554,4558,4562,4567,4571,4575,4579,4583,4587,4591,4595,4599,4603,4607,4611,4615],{"type":43,"tag":539,"props":4543,"children":4544},{"style":749},[4545],{"type":49,"value":2773},{"type":43,"tag":539,"props":4547,"children":4548},{"style":755},[4549],{"type":49,"value":3794},{"type":43,"tag":539,"props":4551,"children":4552},{"style":766},[4553],{"type":49,"value":873},{"type":43,"tag":539,"props":4555,"children":4556},{"style":821},[4557],{"type":49,"value":2640},{"type":43,"tag":539,"props":4559,"children":4560},{"style":904},[4561],{"type":49,"value":892},{"type":43,"tag":539,"props":4563,"children":4564},{"style":2501},[4565],{"type":49,"value":4566},"504",{"type":43,"tag":539,"props":4568,"children":4569},{"style":904},[4570],{"type":49,"value":481},{"type":43,"tag":539,"props":4572,"children":4573},{"style":766},[4574],{"type":49,"value":873},{"type":43,"tag":539,"props":4576,"children":4577},{"style":821},[4578],{"type":49,"value":2237},{"type":43,"tag":539,"props":4580,"children":4581},{"style":904},[4582],{"type":49,"value":892},{"type":43,"tag":539,"props":4584,"children":4585},{"style":766},[4586],{"type":49,"value":2795},{"type":43,"tag":539,"props":4588,"children":4589},{"style":904},[4590],{"type":49,"value":2800},{"type":43,"tag":539,"props":4592,"children":4593},{"style":766},[4594],{"type":49,"value":912},{"type":43,"tag":539,"props":4596,"children":4597},{"style":766},[4598],{"type":49,"value":769},{"type":43,"tag":539,"props":4600,"children":4601},{"style":552},[4602],{"type":49,"value":3023},{"type":43,"tag":539,"props":4604,"children":4605},{"style":766},[4606],{"type":49,"value":778},{"type":43,"tag":539,"props":4608,"children":4609},{"style":766},[4610],{"type":49,"value":2214},{"type":43,"tag":539,"props":4612,"children":4613},{"style":904},[4614],{"type":49,"value":481},{"type":43,"tag":539,"props":4616,"children":4617},{"style":766},[4618],{"type":49,"value":783},{"type":43,"tag":539,"props":4620,"children":4621},{"class":541,"line":3088},[4622],{"type":43,"tag":539,"props":4623,"children":4624},{"style":766},[4625],{"type":49,"value":2716},{"type":43,"tag":539,"props":4627,"children":4628},{"class":541,"line":3118},[4629],{"type":43,"tag":539,"props":4630,"children":4631},{"emptyLinePlaceholder":790},[4632],{"type":49,"value":793},{"type":43,"tag":539,"props":4634,"children":4635},{"class":541,"line":3177},[4636],{"type":43,"tag":539,"props":4637,"children":4638},{"style":739},[4639],{"type":49,"value":4640},"    \u002F\u002F 3. Consume credentials\n",{"type":43,"tag":539,"props":4642,"children":4643},{"class":541,"line":3186},[4644,4648,4652,4656,4660,4664],{"type":43,"tag":539,"props":4645,"children":4646},{"style":800},[4647],{"type":49,"value":2554},{"type":43,"tag":539,"props":4649,"children":4650},{"style":755},[4651],{"type":49,"value":3098},{"type":43,"tag":539,"props":4653,"children":4654},{"style":766},[4655],{"type":49,"value":2219},{"type":43,"tag":539,"props":4657,"children":4658},{"style":749},[4659],{"type":49,"value":863},{"type":43,"tag":539,"props":4661,"children":4662},{"style":821},[4663],{"type":49,"value":3111},{"type":43,"tag":539,"props":4665,"children":4666},{"style":904},[4667],{"type":49,"value":1404},{"type":43,"tag":539,"props":4669,"children":4670},{"class":541,"line":3216},[4671,4676,4680,4684,4688,4692,4696,4700,4704,4708,4712,4716],{"type":43,"tag":539,"props":4672,"children":4673},{"style":766},[4674],{"type":49,"value":4675},"      `${",{"type":43,"tag":539,"props":4677,"children":4678},{"style":755},[4679],{"type":49,"value":3129},{"type":43,"tag":539,"props":4681,"children":4682},{"style":766},[4683],{"type":49,"value":873},{"type":43,"tag":539,"props":4685,"children":4686},{"style":755},[4687],{"type":49,"value":3138},{"type":43,"tag":539,"props":4689,"children":4690},{"style":766},[4691],{"type":49,"value":1086},{"type":43,"tag":539,"props":4693,"children":4694},{"style":552},[4695],{"type":49,"value":3147},{"type":43,"tag":539,"props":4697,"children":4698},{"style":766},[4699],{"type":49,"value":3152},{"type":43,"tag":539,"props":4701,"children":4702},{"style":755},[4703],{"type":49,"value":2597},{"type":43,"tag":539,"props":4705,"children":4706},{"style":766},[4707],{"type":49,"value":1086},{"type":43,"tag":539,"props":4709,"children":4710},{"style":552},[4711],{"type":49,"value":3165},{"type":43,"tag":539,"props":4713,"children":4714},{"style":766},[4715],{"type":49,"value":3170},{"type":43,"tag":539,"props":4717,"children":4718},{"style":766},[4719],{"type":49,"value":930},{"type":43,"tag":539,"props":4721,"children":4722},{"class":541,"line":3233},[4723],{"type":43,"tag":539,"props":4724,"children":4725},{"style":766},[4726],{"type":49,"value":4727},"      {\n",{"type":43,"tag":539,"props":4729,"children":4730},{"class":541,"line":3273},[4731,4736,4740,4744,4748,4752],{"type":43,"tag":539,"props":4732,"children":4733},{"style":904},[4734],{"type":49,"value":4735},"        method",{"type":43,"tag":539,"props":4737,"children":4738},{"style":766},[4739],{"type":49,"value":912},{"type":43,"tag":539,"props":4741,"children":4742},{"style":766},[4743],{"type":49,"value":769},{"type":43,"tag":539,"props":4745,"children":4746},{"style":552},[4747],{"type":49,"value":3205},{"type":43,"tag":539,"props":4749,"children":4750},{"style":766},[4751],{"type":49,"value":778},{"type":43,"tag":539,"props":4753,"children":4754},{"style":766},[4755],{"type":49,"value":930},{"type":43,"tag":539,"props":4757,"children":4758},{"class":541,"line":3312},[4759,4764,4768],{"type":43,"tag":539,"props":4760,"children":4761},{"style":904},[4762],{"type":49,"value":4763},"        headers",{"type":43,"tag":539,"props":4765,"children":4766},{"style":766},[4767],{"type":49,"value":912},{"type":43,"tag":539,"props":4769,"children":4770},{"style":766},[4771],{"type":49,"value":978},{"type":43,"tag":539,"props":4773,"children":4774},{"class":541,"line":3321},[4775,4780,4784,4788,4792,4796,4800,4804],{"type":43,"tag":539,"props":4776,"children":4777},{"style":904},[4778],{"type":49,"value":4779},"          Authorization",{"type":43,"tag":539,"props":4781,"children":4782},{"style":766},[4783],{"type":49,"value":912},{"type":43,"tag":539,"props":4785,"children":4786},{"style":766},[4787],{"type":49,"value":3248},{"type":43,"tag":539,"props":4789,"children":4790},{"style":552},[4791],{"type":49,"value":3253},{"type":43,"tag":539,"props":4793,"children":4794},{"style":766},[4795],{"type":49,"value":3152},{"type":43,"tag":539,"props":4797,"children":4798},{"style":755},[4799],{"type":49,"value":334},{"type":43,"tag":539,"props":4801,"children":4802},{"style":766},[4803],{"type":49,"value":3266},{"type":43,"tag":539,"props":4805,"children":4806},{"style":766},[4807],{"type":49,"value":930},{"type":43,"tag":539,"props":4809,"children":4810},{"class":541,"line":3329},[4811,4816,4820,4824,4828,4832,4836,4840],{"type":43,"tag":539,"props":4812,"children":4813},{"style":766},[4814],{"type":49,"value":4815},"          '",{"type":43,"tag":539,"props":4817,"children":4818},{"style":904},[4819],{"type":49,"value":3284},{"type":43,"tag":539,"props":4821,"children":4822},{"style":766},[4823],{"type":49,"value":778},{"type":43,"tag":539,"props":4825,"children":4826},{"style":766},[4827],{"type":49,"value":912},{"type":43,"tag":539,"props":4829,"children":4830},{"style":766},[4831],{"type":49,"value":769},{"type":43,"tag":539,"props":4833,"children":4834},{"style":552},[4835],{"type":49,"value":3301},{"type":43,"tag":539,"props":4837,"children":4838},{"style":766},[4839],{"type":49,"value":778},{"type":43,"tag":539,"props":4841,"children":4842},{"style":766},[4843],{"type":49,"value":930},{"type":43,"tag":539,"props":4845,"children":4846},{"class":541,"line":3342},[4847],{"type":43,"tag":539,"props":4848,"children":4849},{"style":766},[4850],{"type":49,"value":4851},"        },\n",{"type":43,"tag":539,"props":4853,"children":4854},{"class":541,"line":3383},[4855],{"type":43,"tag":539,"props":4856,"children":4857},{"style":766},[4858],{"type":49,"value":4299},{"type":43,"tag":539,"props":4860,"children":4861},{"class":541,"line":3391},[4862,4867],{"type":43,"tag":539,"props":4863,"children":4864},{"style":904},[4865],{"type":49,"value":4866},"    )",{"type":43,"tag":539,"props":4868,"children":4869},{"style":766},[4870],{"type":49,"value":783},{"type":43,"tag":539,"props":4872,"children":4873},{"class":541,"line":3420},[4874,4878,4882,4886,4890,4894,4898,4902,4906],{"type":43,"tag":539,"props":4875,"children":4876},{"style":800},[4877],{"type":49,"value":2554},{"type":43,"tag":539,"props":4879,"children":4880},{"style":755},[4881],{"type":49,"value":3352},{"type":43,"tag":539,"props":4883,"children":4884},{"style":766},[4885],{"type":49,"value":2219},{"type":43,"tag":539,"props":4887,"children":4888},{"style":749},[4889],{"type":49,"value":863},{"type":43,"tag":539,"props":4891,"children":4892},{"style":755},[4893],{"type":49,"value":3098},{"type":43,"tag":539,"props":4895,"children":4896},{"style":766},[4897],{"type":49,"value":873},{"type":43,"tag":539,"props":4899,"children":4900},{"style":821},[4901],{"type":49,"value":2237},{"type":43,"tag":539,"props":4903,"children":4904},{"style":904},[4905],{"type":49,"value":829},{"type":43,"tag":539,"props":4907,"children":4908},{"style":766},[4909],{"type":49,"value":783},{"type":43,"tag":539,"props":4911,"children":4912},{"class":541,"line":3433},[4913],{"type":43,"tag":539,"props":4914,"children":4915},{"emptyLinePlaceholder":790},[4916],{"type":49,"value":793},{"type":43,"tag":539,"props":4918,"children":4919},{"class":541,"line":3463},[4920,4925,4929,4933,4937],{"type":43,"tag":539,"props":4921,"children":4922},{"style":755},[4923],{"type":49,"value":4924},"    res",{"type":43,"tag":539,"props":4926,"children":4927},{"style":766},[4928],{"type":49,"value":873},{"type":43,"tag":539,"props":4930,"children":4931},{"style":821},[4932],{"type":49,"value":2237},{"type":43,"tag":539,"props":4934,"children":4935},{"style":904},[4936],{"type":49,"value":892},{"type":43,"tag":539,"props":4938,"children":4939},{"style":766},[4940],{"type":49,"value":897},{"type":43,"tag":539,"props":4942,"children":4943},{"class":541,"line":3493},[4944,4949],{"type":43,"tag":539,"props":4945,"children":4946},{"style":755},[4947],{"type":49,"value":4948},"      sessionId",{"type":43,"tag":539,"props":4950,"children":4951},{"style":766},[4952],{"type":49,"value":930},{"type":43,"tag":539,"props":4954,"children":4955},{"class":541,"line":3523},[4956,4961,4965,4969,4973,4977],{"type":43,"tag":539,"props":4957,"children":4958},{"style":904},[4959],{"type":49,"value":4960},"      serverUrl",{"type":43,"tag":539,"props":4962,"children":4963},{"style":766},[4964],{"type":49,"value":912},{"type":43,"tag":539,"props":4966,"children":4967},{"style":755},[4968],{"type":49,"value":3352},{"type":43,"tag":539,"props":4970,"children":4971},{"style":766},[4972],{"type":49,"value":873},{"type":43,"tag":539,"props":4974,"children":4975},{"style":755},[4976],{"type":49,"value":3456},{"type":43,"tag":539,"props":4978,"children":4979},{"style":766},[4980],{"type":49,"value":930},{"type":43,"tag":539,"props":4982,"children":4983},{"class":541,"line":3539},[4984,4989,4993,4997,5001,5005],{"type":43,"tag":539,"props":4985,"children":4986},{"style":904},[4987],{"type":49,"value":4988},"      token",{"type":43,"tag":539,"props":4990,"children":4991},{"style":766},[4992],{"type":49,"value":912},{"type":43,"tag":539,"props":4994,"children":4995},{"style":755},[4996],{"type":49,"value":3352},{"type":43,"tag":539,"props":4998,"children":4999},{"style":766},[5000],{"type":49,"value":873},{"type":43,"tag":539,"props":5002,"children":5003},{"style":755},[5004],{"type":49,"value":3486},{"type":43,"tag":539,"props":5006,"children":5007},{"style":766},[5008],{"type":49,"value":930},{"type":43,"tag":539,"props":5010,"children":5012},{"class":541,"line":5011},55,[5013,5018,5022,5026,5030,5034],{"type":43,"tag":539,"props":5014,"children":5015},{"style":904},[5016],{"type":49,"value":5017},"      roomName",{"type":43,"tag":539,"props":5019,"children":5020},{"style":766},[5021],{"type":49,"value":912},{"type":43,"tag":539,"props":5023,"children":5024},{"style":755},[5025],{"type":49,"value":3352},{"type":43,"tag":539,"props":5027,"children":5028},{"style":766},[5029],{"type":49,"value":873},{"type":43,"tag":539,"props":5031,"children":5032},{"style":755},[5033],{"type":49,"value":3516},{"type":43,"tag":539,"props":5035,"children":5036},{"style":766},[5037],{"type":49,"value":930},{"type":43,"tag":539,"props":5039,"children":5041},{"class":541,"line":5040},56,[5042,5046,5050],{"type":43,"tag":539,"props":5043,"children":5044},{"style":766},[5045],{"type":49,"value":4021},{"type":43,"tag":539,"props":5047,"children":5048},{"style":904},[5049],{"type":49,"value":481},{"type":43,"tag":539,"props":5051,"children":5052},{"style":766},[5053],{"type":49,"value":783},{"type":43,"tag":539,"props":5055,"children":5056},{"class":541,"line":24},[5057,5061,5066,5070,5075,5079],{"type":43,"tag":539,"props":5058,"children":5059},{"style":766},[5060],{"type":49,"value":2412},{"type":43,"tag":539,"props":5062,"children":5063},{"style":749},[5064],{"type":49,"value":5065}," catch",{"type":43,"tag":539,"props":5067,"children":5068},{"style":904},[5069],{"type":49,"value":493},{"type":43,"tag":539,"props":5071,"children":5072},{"style":755},[5073],{"type":49,"value":5074},"error",{"type":43,"tag":539,"props":5076,"children":5077},{"style":904},[5078],{"type":49,"value":2541},{"type":43,"tag":539,"props":5080,"children":5081},{"style":766},[5082],{"type":49,"value":897},{"type":43,"tag":539,"props":5084,"children":5086},{"class":541,"line":5085},58,[5087,5092,5096,5100,5104,5108,5113,5117,5121,5125,5129],{"type":43,"tag":539,"props":5088,"children":5089},{"style":755},[5090],{"type":49,"value":5091},"    console",{"type":43,"tag":539,"props":5093,"children":5094},{"style":766},[5095],{"type":49,"value":873},{"type":43,"tag":539,"props":5097,"children":5098},{"style":821},[5099],{"type":49,"value":5074},{"type":43,"tag":539,"props":5101,"children":5102},{"style":904},[5103],{"type":49,"value":892},{"type":43,"tag":539,"props":5105,"children":5106},{"style":766},[5107],{"type":49,"value":778},{"type":43,"tag":539,"props":5109,"children":5110},{"style":552},[5111],{"type":49,"value":5112},"Session creation failed:",{"type":43,"tag":539,"props":5114,"children":5115},{"style":766},[5116],{"type":49,"value":778},{"type":43,"tag":539,"props":5118,"children":5119},{"style":766},[5120],{"type":49,"value":1141},{"type":43,"tag":539,"props":5122,"children":5123},{"style":755},[5124],{"type":49,"value":2800},{"type":43,"tag":539,"props":5126,"children":5127},{"style":904},[5128],{"type":49,"value":481},{"type":43,"tag":539,"props":5130,"children":5131},{"style":766},[5132],{"type":49,"value":783},{"type":43,"tag":539,"props":5134,"children":5136},{"class":541,"line":5135},59,[5137,5141,5145,5149,5153,5157,5161,5165,5169,5173,5177,5181,5185,5189,5194,5199,5204,5208,5212,5217,5222,5226,5231,5235,5239,5243],{"type":43,"tag":539,"props":5138,"children":5139},{"style":755},[5140],{"type":49,"value":4924},{"type":43,"tag":539,"props":5142,"children":5143},{"style":766},[5144],{"type":49,"value":873},{"type":43,"tag":539,"props":5146,"children":5147},{"style":821},[5148],{"type":49,"value":2640},{"type":43,"tag":539,"props":5150,"children":5151},{"style":904},[5152],{"type":49,"value":892},{"type":43,"tag":539,"props":5154,"children":5155},{"style":2501},[5156],{"type":49,"value":4375},{"type":43,"tag":539,"props":5158,"children":5159},{"style":904},[5160],{"type":49,"value":481},{"type":43,"tag":539,"props":5162,"children":5163},{"style":766},[5164],{"type":49,"value":873},{"type":43,"tag":539,"props":5166,"children":5167},{"style":821},[5168],{"type":49,"value":2237},{"type":43,"tag":539,"props":5170,"children":5171},{"style":904},[5172],{"type":49,"value":892},{"type":43,"tag":539,"props":5174,"children":5175},{"style":766},[5176],{"type":49,"value":2795},{"type":43,"tag":539,"props":5178,"children":5179},{"style":904},[5180],{"type":49,"value":2800},{"type":43,"tag":539,"props":5182,"children":5183},{"style":766},[5184],{"type":49,"value":912},{"type":43,"tag":539,"props":5186,"children":5187},{"style":755},[5188],{"type":49,"value":2800},{"type":43,"tag":539,"props":5190,"children":5191},{"style":766},[5192],{"type":49,"value":5193}," instanceof",{"type":43,"tag":539,"props":5195,"children":5196},{"style":546},[5197],{"type":49,"value":5198}," Error",{"type":43,"tag":539,"props":5200,"children":5201},{"style":766},[5202],{"type":49,"value":5203}," ?",{"type":43,"tag":539,"props":5205,"children":5206},{"style":755},[5207],{"type":49,"value":2800},{"type":43,"tag":539,"props":5209,"children":5210},{"style":766},[5211],{"type":49,"value":873},{"type":43,"tag":539,"props":5213,"children":5214},{"style":755},[5215],{"type":49,"value":5216},"message",{"type":43,"tag":539,"props":5218,"children":5219},{"style":766},[5220],{"type":49,"value":5221}," :",{"type":43,"tag":539,"props":5223,"children":5224},{"style":766},[5225],{"type":49,"value":769},{"type":43,"tag":539,"props":5227,"children":5228},{"style":552},[5229],{"type":49,"value":5230},"Unknown error",{"type":43,"tag":539,"props":5232,"children":5233},{"style":766},[5234],{"type":49,"value":778},{"type":43,"tag":539,"props":5236,"children":5237},{"style":766},[5238],{"type":49,"value":2214},{"type":43,"tag":539,"props":5240,"children":5241},{"style":904},[5242],{"type":49,"value":481},{"type":43,"tag":539,"props":5244,"children":5245},{"style":766},[5246],{"type":49,"value":783},{"type":43,"tag":539,"props":5248,"children":5250},{"class":541,"line":5249},60,[5251],{"type":43,"tag":539,"props":5252,"children":5253},{"style":766},[5254],{"type":49,"value":2939},{"type":43,"tag":539,"props":5256,"children":5258},{"class":541,"line":5257},61,[5259,5263,5267],{"type":43,"tag":539,"props":5260,"children":5261},{"style":766},[5262],{"type":49,"value":1086},{"type":43,"tag":539,"props":5264,"children":5265},{"style":755},[5266],{"type":49,"value":481},{"type":43,"tag":539,"props":5268,"children":5269},{"style":766},[5270],{"type":49,"value":783},{"type":43,"tag":185,"props":5272,"children":5274},{"id":5273},"fastapi-python",[5275],{"type":49,"value":5276},"FastAPI (Python)",{"type":43,"tag":263,"props":5278,"children":5280},{"className":1162,"code":5279,"language":1164,"meta":271,"style":271},"import time\nimport httpx\nfrom fastapi import FastAPI, HTTPException\nfrom pydantic import BaseModel\nfrom runwayml import RunwayML\n\napp = FastAPI()\nclient = RunwayML()\n\nclass SessionRequest(BaseModel):\n    avatar_id: str\n\n@app.post(\"\u002Fapi\u002Favatar\u002Fsession\")\nasync def create_session(req: SessionRequest):\n    # 1. Create session\n    result = client.realtime_sessions.create(\n        model='gwm1_avatars',\n        avatar={'type': 'custom', 'avatar_id': req.avatar_id},\n    )\n    session_id = result.id\n\n    # 2. Poll until ready\n    session_key = None\n    for _ in range(60):\n        session = client.realtime_sessions.retrieve(session_id)\n\n        if session.status == 'READY':\n            session_key = session.session_key\n            break\n        if session.status == 'FAILED':\n            raise HTTPException(status_code=500, detail=str(session.failure))\n\n        time.sleep(1)\n\n    if not session_key:\n        raise HTTPException(status_code=504, detail='Session timed out')\n\n    # 3. Consume credentials\n    async with httpx.AsyncClient() as http:\n        resp = await http.post(\n            f\"{client.base_url}\u002Fv1\u002Frealtime_sessions\u002F{session_id}\u002Fconsume\",\n            headers={\n                \"Authorization\": f\"Bearer {session_key}\",\n                \"X-Runway-Version\": \"2024-11-06\",\n            },\n        )\n    credentials = resp.json()\n\n    return {\n        \"session_id\": session_id,\n        \"server_url\": credentials[\"url\"],\n        \"token\": credentials[\"token\"],\n        \"room_name\": credentials[\"roomName\"],\n    }\n",[5281],{"type":43,"tag":74,"props":5282,"children":5283},{"__ignoreMap":271},[5284,5292,5300,5308,5316,5323,5330,5338,5345,5352,5360,5368,5375,5383,5391,5399,5407,5415,5423,5431,5439,5446,5454,5462,5470,5478,5485,5493,5501,5509,5517,5525,5532,5540,5547,5555,5563,5570,5578,5586,5594,5602,5610,5618,5626,5634,5642,5650,5657,5665,5673,5681,5689,5697],{"type":43,"tag":539,"props":5285,"children":5286},{"class":541,"line":542},[5287],{"type":43,"tag":539,"props":5288,"children":5289},{},[5290],{"type":49,"value":5291},"import time\n",{"type":43,"tag":539,"props":5293,"children":5294},{"class":541,"line":745},[5295],{"type":43,"tag":539,"props":5296,"children":5297},{},[5298],{"type":49,"value":5299},"import httpx\n",{"type":43,"tag":539,"props":5301,"children":5302},{"class":541,"line":786},[5303],{"type":43,"tag":539,"props":5304,"children":5305},{},[5306],{"type":49,"value":5307},"from fastapi import FastAPI, HTTPException\n",{"type":43,"tag":539,"props":5309,"children":5310},{"class":541,"line":796},[5311],{"type":43,"tag":539,"props":5312,"children":5313},{},[5314],{"type":49,"value":5315},"from pydantic import BaseModel\n",{"type":43,"tag":539,"props":5317,"children":5318},{"class":541,"line":836},[5319],{"type":43,"tag":539,"props":5320,"children":5321},{},[5322],{"type":49,"value":1184},{"type":43,"tag":539,"props":5324,"children":5325},{"class":541,"line":844},[5326],{"type":43,"tag":539,"props":5327,"children":5328},{"emptyLinePlaceholder":790},[5329],{"type":49,"value":793},{"type":43,"tag":539,"props":5331,"children":5332},{"class":541,"line":900},[5333],{"type":43,"tag":539,"props":5334,"children":5335},{},[5336],{"type":49,"value":5337},"app = FastAPI()\n",{"type":43,"tag":539,"props":5339,"children":5340},{"class":541,"line":933},[5341],{"type":43,"tag":539,"props":5342,"children":5343},{},[5344],{"type":49,"value":1199},{"type":43,"tag":539,"props":5346,"children":5347},{"class":541,"line":963},[5348],{"type":43,"tag":539,"props":5349,"children":5350},{"emptyLinePlaceholder":790},[5351],{"type":49,"value":793},{"type":43,"tag":539,"props":5353,"children":5354},{"class":541,"line":981},[5355],{"type":43,"tag":539,"props":5356,"children":5357},{},[5358],{"type":49,"value":5359},"class SessionRequest(BaseModel):\n",{"type":43,"tag":539,"props":5361,"children":5362},{"class":541,"line":1011},[5363],{"type":43,"tag":539,"props":5364,"children":5365},{},[5366],{"type":49,"value":5367},"    avatar_id: str\n",{"type":43,"tag":539,"props":5369,"children":5370},{"class":541,"line":1041},[5371],{"type":43,"tag":539,"props":5372,"children":5373},{"emptyLinePlaceholder":790},[5374],{"type":49,"value":793},{"type":43,"tag":539,"props":5376,"children":5377},{"class":541,"line":1050},[5378],{"type":43,"tag":539,"props":5379,"children":5380},{},[5381],{"type":49,"value":5382},"@app.post(\"\u002Fapi\u002Favatar\u002Fsession\")\n",{"type":43,"tag":539,"props":5384,"children":5385},{"class":541,"line":1080},[5386],{"type":43,"tag":539,"props":5387,"children":5388},{},[5389],{"type":49,"value":5390},"async def create_session(req: SessionRequest):\n",{"type":43,"tag":539,"props":5392,"children":5393},{"class":541,"line":28},[5394],{"type":43,"tag":539,"props":5395,"children":5396},{},[5397],{"type":49,"value":5398},"    # 1. Create session\n",{"type":43,"tag":539,"props":5400,"children":5401},{"class":541,"line":1104},[5402],{"type":43,"tag":539,"props":5403,"children":5404},{},[5405],{"type":49,"value":5406},"    result = client.realtime_sessions.create(\n",{"type":43,"tag":539,"props":5408,"children":5409},{"class":541,"line":2474},[5410],{"type":43,"tag":539,"props":5411,"children":5412},{},[5413],{"type":49,"value":5414},"        model='gwm1_avatars',\n",{"type":43,"tag":539,"props":5416,"children":5417},{"class":541,"line":2548},[5418],{"type":43,"tag":539,"props":5419,"children":5420},{},[5421],{"type":49,"value":5422},"        avatar={'type': 'custom', 'avatar_id': req.avatar_id},\n",{"type":43,"tag":539,"props":5424,"children":5425},{"class":541,"line":2608},[5426],{"type":43,"tag":539,"props":5427,"children":5428},{},[5429],{"type":49,"value":5430},"    )\n",{"type":43,"tag":539,"props":5432,"children":5433},{"class":541,"line":2616},[5434],{"type":43,"tag":539,"props":5435,"children":5436},{},[5437],{"type":49,"value":5438},"    session_id = result.id\n",{"type":43,"tag":539,"props":5440,"children":5441},{"class":541,"line":2668},[5442],{"type":43,"tag":539,"props":5443,"children":5444},{"emptyLinePlaceholder":790},[5445],{"type":49,"value":793},{"type":43,"tag":539,"props":5447,"children":5448},{"class":541,"line":2697},[5449],{"type":43,"tag":539,"props":5450,"children":5451},{},[5452],{"type":49,"value":5453},"    # 2. Poll until ready\n",{"type":43,"tag":539,"props":5455,"children":5456},{"class":541,"line":2710},[5457],{"type":43,"tag":539,"props":5458,"children":5459},{},[5460],{"type":49,"value":5461},"    session_key = None\n",{"type":43,"tag":539,"props":5463,"children":5464},{"class":541,"line":2719},[5465],{"type":43,"tag":539,"props":5466,"children":5467},{},[5468],{"type":49,"value":5469},"    for _ in range(60):\n",{"type":43,"tag":539,"props":5471,"children":5472},{"class":541,"line":2767},[5473],{"type":43,"tag":539,"props":5474,"children":5475},{},[5476],{"type":49,"value":5477},"        session = client.realtime_sessions.retrieve(session_id)\n",{"type":43,"tag":539,"props":5479,"children":5480},{"class":541,"line":2854},[5481],{"type":43,"tag":539,"props":5482,"children":5483},{"emptyLinePlaceholder":790},[5484],{"type":49,"value":793},{"type":43,"tag":539,"props":5486,"children":5487},{"class":541,"line":2862},[5488],{"type":43,"tag":539,"props":5489,"children":5490},{},[5491],{"type":49,"value":5492},"        if session.status == 'READY':\n",{"type":43,"tag":539,"props":5494,"children":5495},{"class":541,"line":2870},[5496],{"type":43,"tag":539,"props":5497,"children":5498},{},[5499],{"type":49,"value":5500},"            session_key = session.session_key\n",{"type":43,"tag":539,"props":5502,"children":5503},{"class":541,"line":2933},[5504],{"type":43,"tag":539,"props":5505,"children":5506},{},[5507],{"type":49,"value":5508},"            break\n",{"type":43,"tag":539,"props":5510,"children":5511},{"class":541,"line":2942},[5512],{"type":43,"tag":539,"props":5513,"children":5514},{},[5515],{"type":49,"value":5516},"        if session.status == 'FAILED':\n",{"type":43,"tag":539,"props":5518,"children":5519},{"class":541,"line":2950},[5520],{"type":43,"tag":539,"props":5521,"children":5522},{},[5523],{"type":49,"value":5524},"            raise HTTPException(status_code=500, detail=str(session.failure))\n",{"type":43,"tag":539,"props":5526,"children":5527},{"class":541,"line":2980},[5528],{"type":43,"tag":539,"props":5529,"children":5530},{"emptyLinePlaceholder":790},[5531],{"type":49,"value":793},{"type":43,"tag":539,"props":5533,"children":5534},{"class":541,"line":3063},[5535],{"type":43,"tag":539,"props":5536,"children":5537},{},[5538],{"type":49,"value":5539},"        time.sleep(1)\n",{"type":43,"tag":539,"props":5541,"children":5542},{"class":541,"line":3071},[5543],{"type":43,"tag":539,"props":5544,"children":5545},{"emptyLinePlaceholder":790},[5546],{"type":49,"value":793},{"type":43,"tag":539,"props":5548,"children":5549},{"class":541,"line":3079},[5550],{"type":43,"tag":539,"props":5551,"children":5552},{},[5553],{"type":49,"value":5554},"    if not session_key:\n",{"type":43,"tag":539,"props":5556,"children":5557},{"class":541,"line":3088},[5558],{"type":43,"tag":539,"props":5559,"children":5560},{},[5561],{"type":49,"value":5562},"        raise HTTPException(status_code=504, detail='Session timed out')\n",{"type":43,"tag":539,"props":5564,"children":5565},{"class":541,"line":3118},[5566],{"type":43,"tag":539,"props":5567,"children":5568},{"emptyLinePlaceholder":790},[5569],{"type":49,"value":793},{"type":43,"tag":539,"props":5571,"children":5572},{"class":541,"line":3177},[5573],{"type":43,"tag":539,"props":5574,"children":5575},{},[5576],{"type":49,"value":5577},"    # 3. Consume credentials\n",{"type":43,"tag":539,"props":5579,"children":5580},{"class":541,"line":3186},[5581],{"type":43,"tag":539,"props":5582,"children":5583},{},[5584],{"type":49,"value":5585},"    async with httpx.AsyncClient() as http:\n",{"type":43,"tag":539,"props":5587,"children":5588},{"class":541,"line":3216},[5589],{"type":43,"tag":539,"props":5590,"children":5591},{},[5592],{"type":49,"value":5593},"        resp = await http.post(\n",{"type":43,"tag":539,"props":5595,"children":5596},{"class":541,"line":3233},[5597],{"type":43,"tag":539,"props":5598,"children":5599},{},[5600],{"type":49,"value":5601},"            f\"{client.base_url}\u002Fv1\u002Frealtime_sessions\u002F{session_id}\u002Fconsume\",\n",{"type":43,"tag":539,"props":5603,"children":5604},{"class":541,"line":3273},[5605],{"type":43,"tag":539,"props":5606,"children":5607},{},[5608],{"type":49,"value":5609},"            headers={\n",{"type":43,"tag":539,"props":5611,"children":5612},{"class":541,"line":3312},[5613],{"type":43,"tag":539,"props":5614,"children":5615},{},[5616],{"type":49,"value":5617},"                \"Authorization\": f\"Bearer {session_key}\",\n",{"type":43,"tag":539,"props":5619,"children":5620},{"class":541,"line":3321},[5621],{"type":43,"tag":539,"props":5622,"children":5623},{},[5624],{"type":49,"value":5625},"                \"X-Runway-Version\": \"2024-11-06\",\n",{"type":43,"tag":539,"props":5627,"children":5628},{"class":541,"line":3329},[5629],{"type":43,"tag":539,"props":5630,"children":5631},{},[5632],{"type":49,"value":5633},"            },\n",{"type":43,"tag":539,"props":5635,"children":5636},{"class":541,"line":3342},[5637],{"type":43,"tag":539,"props":5638,"children":5639},{},[5640],{"type":49,"value":5641},"        )\n",{"type":43,"tag":539,"props":5643,"children":5644},{"class":541,"line":3383},[5645],{"type":43,"tag":539,"props":5646,"children":5647},{},[5648],{"type":49,"value":5649},"    credentials = resp.json()\n",{"type":43,"tag":539,"props":5651,"children":5652},{"class":541,"line":3391},[5653],{"type":43,"tag":539,"props":5654,"children":5655},{"emptyLinePlaceholder":790},[5656],{"type":49,"value":793},{"type":43,"tag":539,"props":5658,"children":5659},{"class":541,"line":3420},[5660],{"type":43,"tag":539,"props":5661,"children":5662},{},[5663],{"type":49,"value":5664},"    return {\n",{"type":43,"tag":539,"props":5666,"children":5667},{"class":541,"line":3433},[5668],{"type":43,"tag":539,"props":5669,"children":5670},{},[5671],{"type":49,"value":5672},"        \"session_id\": session_id,\n",{"type":43,"tag":539,"props":5674,"children":5675},{"class":541,"line":3463},[5676],{"type":43,"tag":539,"props":5677,"children":5678},{},[5679],{"type":49,"value":5680},"        \"server_url\": credentials[\"url\"],\n",{"type":43,"tag":539,"props":5682,"children":5683},{"class":541,"line":3493},[5684],{"type":43,"tag":539,"props":5685,"children":5686},{},[5687],{"type":49,"value":5688},"        \"token\": credentials[\"token\"],\n",{"type":43,"tag":539,"props":5690,"children":5691},{"class":541,"line":3523},[5692],{"type":43,"tag":539,"props":5693,"children":5694},{},[5695],{"type":49,"value":5696},"        \"room_name\": credentials[\"roomName\"],\n",{"type":43,"tag":539,"props":5698,"children":5699},{"class":541,"line":3539},[5700],{"type":43,"tag":539,"props":5701,"children":5702},{},[5703],{"type":49,"value":2716},{"type":43,"tag":178,"props":5705,"children":5707},{"id":5706},"step-4-connect-from-the-client",[5708],{"type":49,"value":5709},"Step 4: Connect from the Client",{"type":43,"tag":56,"props":5711,"children":5712},{},[5713,5715,5720],{"type":49,"value":5714},"See ",{"type":43,"tag":74,"props":5716,"children":5718},{"className":5717},[],[5719],{"type":49,"value":144},{"type":49,"value":5721}," for the React SDK components that handle WebRTC connection and rendering. The simplest approach:",{"type":43,"tag":263,"props":5723,"children":5727},{"className":5724,"code":5725,"language":5726,"meta":271,"style":271},"language-tsx shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","'use client';\nimport { AvatarCall } from '@runwayml\u002Favatars-react';\nimport '@runwayml\u002Favatars-react\u002Fstyles.css';\n\nexport default function CharacterPage() {\n  return (\n    \u003CAvatarCall\n      avatarId=\"your-avatar-id\"\n      connectUrl=\"\u002Fapi\u002Favatar\u002Fsession\"\n      onEnd={() => console.log('Call ended')}\n      onError={(error) => console.error('Error:', error)}\n    \u002F>\n  );\n}\n","tsx",[5728],{"type":43,"tag":74,"props":5729,"children":5730},{"__ignoreMap":271},[5731,5751,5792,5816,5823,5852,5864,5877,5904,5928,5983,6050,6058,6069],{"type":43,"tag":539,"props":5732,"children":5733},{"class":541,"line":542},[5734,5738,5743,5747],{"type":43,"tag":539,"props":5735,"children":5736},{"style":766},[5737],{"type":49,"value":778},{"type":43,"tag":539,"props":5739,"children":5740},{"style":552},[5741],{"type":49,"value":5742},"use client",{"type":43,"tag":539,"props":5744,"children":5745},{"style":766},[5746],{"type":49,"value":778},{"type":43,"tag":539,"props":5748,"children":5749},{"style":766},[5750],{"type":49,"value":783},{"type":43,"tag":539,"props":5752,"children":5753},{"class":541,"line":745},[5754,5758,5762,5767,5771,5776,5780,5784,5788],{"type":43,"tag":539,"props":5755,"children":5756},{"style":749},[5757],{"type":49,"value":752},{"type":43,"tag":539,"props":5759,"children":5760},{"style":766},[5761],{"type":49,"value":1579},{"type":43,"tag":539,"props":5763,"children":5764},{"style":755},[5765],{"type":49,"value":5766}," AvatarCall",{"type":43,"tag":539,"props":5768,"children":5769},{"style":766},[5770],{"type":49,"value":2214},{"type":43,"tag":539,"props":5772,"children":5773},{"style":749},[5774],{"type":49,"value":5775}," from",{"type":43,"tag":539,"props":5777,"children":5778},{"style":766},[5779],{"type":49,"value":769},{"type":43,"tag":539,"props":5781,"children":5782},{"style":552},[5783],{"type":49,"value":588},{"type":43,"tag":539,"props":5785,"children":5786},{"style":766},[5787],{"type":49,"value":778},{"type":43,"tag":539,"props":5789,"children":5790},{"style":766},[5791],{"type":49,"value":783},{"type":43,"tag":539,"props":5793,"children":5794},{"class":541,"line":786},[5795,5799,5803,5808,5812],{"type":43,"tag":539,"props":5796,"children":5797},{"style":749},[5798],{"type":49,"value":752},{"type":43,"tag":539,"props":5800,"children":5801},{"style":766},[5802],{"type":49,"value":769},{"type":43,"tag":539,"props":5804,"children":5805},{"style":552},[5806],{"type":49,"value":5807},"@runwayml\u002Favatars-react\u002Fstyles.css",{"type":43,"tag":539,"props":5809,"children":5810},{"style":766},[5811],{"type":49,"value":778},{"type":43,"tag":539,"props":5813,"children":5814},{"style":766},[5815],{"type":49,"value":783},{"type":43,"tag":539,"props":5817,"children":5818},{"class":541,"line":796},[5819],{"type":43,"tag":539,"props":5820,"children":5821},{"emptyLinePlaceholder":790},[5822],{"type":49,"value":793},{"type":43,"tag":539,"props":5824,"children":5825},{"class":541,"line":836},[5826,5830,5835,5839,5844,5848],{"type":43,"tag":539,"props":5827,"children":5828},{"style":749},[5829],{"type":49,"value":2150},{"type":43,"tag":539,"props":5831,"children":5832},{"style":749},[5833],{"type":49,"value":5834}," default",{"type":43,"tag":539,"props":5836,"children":5837},{"style":800},[5838],{"type":49,"value":2160},{"type":43,"tag":539,"props":5840,"children":5841},{"style":821},[5842],{"type":49,"value":5843}," CharacterPage",{"type":43,"tag":539,"props":5845,"children":5846},{"style":766},[5847],{"type":49,"value":829},{"type":43,"tag":539,"props":5849,"children":5850},{"style":766},[5851],{"type":49,"value":978},{"type":43,"tag":539,"props":5853,"children":5854},{"class":541,"line":844},[5855,5859],{"type":43,"tag":539,"props":5856,"children":5857},{"style":749},[5858],{"type":49,"value":3397},{"type":43,"tag":539,"props":5860,"children":5861},{"style":904},[5862],{"type":49,"value":5863}," (\n",{"type":43,"tag":539,"props":5865,"children":5866},{"class":541,"line":900},[5867,5872],{"type":43,"tag":539,"props":5868,"children":5869},{"style":766},[5870],{"type":49,"value":5871},"    \u003C",{"type":43,"tag":539,"props":5873,"children":5874},{"style":546},[5875],{"type":49,"value":5876},"AvatarCall\n",{"type":43,"tag":539,"props":5878,"children":5879},{"class":541,"line":933},[5880,5885,5889,5894,5899],{"type":43,"tag":539,"props":5881,"children":5882},{"style":800},[5883],{"type":49,"value":5884},"      avatarId",{"type":43,"tag":539,"props":5886,"children":5887},{"style":766},[5888],{"type":49,"value":813},{"type":43,"tag":539,"props":5890,"children":5891},{"style":766},[5892],{"type":49,"value":5893},"\"",{"type":43,"tag":539,"props":5895,"children":5896},{"style":552},[5897],{"type":49,"value":5898},"your-avatar-id",{"type":43,"tag":539,"props":5900,"children":5901},{"style":766},[5902],{"type":49,"value":5903},"\"\n",{"type":43,"tag":539,"props":5905,"children":5906},{"class":541,"line":963},[5907,5912,5916,5920,5924],{"type":43,"tag":539,"props":5908,"children":5909},{"style":800},[5910],{"type":49,"value":5911},"      connectUrl",{"type":43,"tag":539,"props":5913,"children":5914},{"style":766},[5915],{"type":49,"value":813},{"type":43,"tag":539,"props":5917,"children":5918},{"style":766},[5919],{"type":49,"value":5893},{"type":43,"tag":539,"props":5921,"children":5922},{"style":552},[5923],{"type":49,"value":3764},{"type":43,"tag":539,"props":5925,"children":5926},{"style":766},[5927],{"type":49,"value":5903},{"type":43,"tag":539,"props":5929,"children":5930},{"class":541,"line":981},[5931,5936,5941,5945,5950,5954,5958,5962,5966,5971,5975,5979],{"type":43,"tag":539,"props":5932,"children":5933},{"style":800},[5934],{"type":49,"value":5935},"      onEnd",{"type":43,"tag":539,"props":5937,"children":5938},{"style":766},[5939],{"type":49,"value":5940},"={()",{"type":43,"tag":539,"props":5942,"children":5943},{"style":800},[5944],{"type":49,"value":2899},{"type":43,"tag":539,"props":5946,"children":5947},{"style":755},[5948],{"type":49,"value":5949}," console",{"type":43,"tag":539,"props":5951,"children":5952},{"style":766},[5953],{"type":49,"value":873},{"type":43,"tag":539,"props":5955,"children":5956},{"style":821},[5957],{"type":49,"value":1119},{"type":43,"tag":539,"props":5959,"children":5960},{"style":755},[5961],{"type":49,"value":892},{"type":43,"tag":539,"props":5963,"children":5964},{"style":766},[5965],{"type":49,"value":778},{"type":43,"tag":539,"props":5967,"children":5968},{"style":552},[5969],{"type":49,"value":5970},"Call ended",{"type":43,"tag":539,"props":5972,"children":5973},{"style":766},[5974],{"type":49,"value":778},{"type":43,"tag":539,"props":5976,"children":5977},{"style":755},[5978],{"type":49,"value":481},{"type":43,"tag":539,"props":5980,"children":5981},{"style":766},[5982],{"type":49,"value":3545},{"type":43,"tag":539,"props":5984,"children":5985},{"class":541,"line":1011},[5986,5991,5996,6000,6004,6008,6012,6016,6020,6024,6028,6033,6037,6041,6046],{"type":43,"tag":539,"props":5987,"children":5988},{"style":800},[5989],{"type":49,"value":5990},"      onError",{"type":43,"tag":539,"props":5992,"children":5993},{"style":766},[5994],{"type":49,"value":5995},"={(",{"type":43,"tag":539,"props":5997,"children":5998},{"style":2172},[5999],{"type":49,"value":5074},{"type":43,"tag":539,"props":6001,"children":6002},{"style":766},[6003],{"type":49,"value":481},{"type":43,"tag":539,"props":6005,"children":6006},{"style":800},[6007],{"type":49,"value":2899},{"type":43,"tag":539,"props":6009,"children":6010},{"style":755},[6011],{"type":49,"value":5949},{"type":43,"tag":539,"props":6013,"children":6014},{"style":766},[6015],{"type":49,"value":873},{"type":43,"tag":539,"props":6017,"children":6018},{"style":821},[6019],{"type":49,"value":5074},{"type":43,"tag":539,"props":6021,"children":6022},{"style":755},[6023],{"type":49,"value":892},{"type":43,"tag":539,"props":6025,"children":6026},{"style":766},[6027],{"type":49,"value":778},{"type":43,"tag":539,"props":6029,"children":6030},{"style":552},[6031],{"type":49,"value":6032},"Error:",{"type":43,"tag":539,"props":6034,"children":6035},{"style":766},[6036],{"type":49,"value":778},{"type":43,"tag":539,"props":6038,"children":6039},{"style":766},[6040],{"type":49,"value":1141},{"type":43,"tag":539,"props":6042,"children":6043},{"style":755},[6044],{"type":49,"value":6045}," error)",{"type":43,"tag":539,"props":6047,"children":6048},{"style":766},[6049],{"type":49,"value":3545},{"type":43,"tag":539,"props":6051,"children":6052},{"class":541,"line":1041},[6053],{"type":43,"tag":539,"props":6054,"children":6055},{"style":766},[6056],{"type":49,"value":6057},"    \u002F>\n",{"type":43,"tag":539,"props":6059,"children":6060},{"class":541,"line":1050},[6061,6065],{"type":43,"tag":539,"props":6062,"children":6063},{"style":904},[6064],{"type":49,"value":3335},{"type":43,"tag":539,"props":6066,"children":6067},{"style":766},[6068],{"type":49,"value":783},{"type":43,"tag":539,"props":6070,"children":6071},{"class":541,"line":1080},[6072],{"type":43,"tag":539,"props":6073,"children":6074},{"style":766},[6075],{"type":49,"value":3545},{"type":43,"tag":178,"props":6077,"children":6079},{"id":6078},"troubleshooting",[6080],{"type":49,"value":6081},"Troubleshooting",{"type":43,"tag":66,"props":6083,"children":6084},{},[6085,6103,6113,6123],{"type":43,"tag":70,"props":6086,"children":6087},{},[6088,6093,6095,6101],{"type":43,"tag":60,"props":6089,"children":6090},{},[6091],{"type":49,"value":6092},"API key errors:",{"type":49,"value":6094}," Key starts with ",{"type":43,"tag":74,"props":6096,"children":6098},{"className":6097},[],[6099],{"type":49,"value":6100},"key_",{"type":49,"value":6102}," followed by 128 hex chars. Ensure it's active.",{"type":43,"tag":70,"props":6104,"children":6105},{},[6106,6111],{"type":43,"tag":60,"props":6107,"children":6108},{},[6109],{"type":49,"value":6110},"No credits:",{"type":49,"value":6112}," Account must have prepaid credits before starting a call.",{"type":43,"tag":70,"props":6114,"children":6115},{},[6116,6121],{"type":43,"tag":60,"props":6117,"children":6118},{},[6119],{"type":49,"value":6120},"Session timeout:",{"type":49,"value":6122}," The 60-iteration poll loop waits ~60 seconds. If sessions consistently time out, check your tier's concurrency limits.",{"type":43,"tag":70,"props":6124,"children":6125},{},[6126,6131],{"type":43,"tag":60,"props":6127,"children":6128},{},[6129],{"type":49,"value":6130},"Credentials already consumed:",{"type":49,"value":6132}," Session credentials are one-time use. If WebRTC fails after consume, create a new session.",{"type":43,"tag":185,"props":6134,"children":6136},{"id":6135},"debug-logging",[6137],{"type":49,"value":6138},"Debug logging",{"type":43,"tag":263,"props":6140,"children":6142},{"className":5724,"code":6141,"language":5726,"meta":271,"style":271},"\u003CAvatarCall\n  avatarId=\"your-avatar-id\"\n  connectUrl=\"\u002Fapi\u002Favatar\u002Fsession\"\n  onError={(error) => {\n    console.error('Avatar error:', error);\n    console.error('Error name:', error.name);\n    console.error('Error message:', error.message);\n    if (error.cause) console.error('Cause:', error.cause);\n  }}\n\u002F>\n",[6143],{"type":43,"tag":74,"props":6144,"children":6145},{"__ignoreMap":271},[6146,6158,6182,6206,6234,6282,6339,6395,6476,6484],{"type":43,"tag":539,"props":6147,"children":6148},{"class":541,"line":542},[6149,6154],{"type":43,"tag":539,"props":6150,"children":6151},{"style":766},[6152],{"type":49,"value":6153},"\u003C",{"type":43,"tag":539,"props":6155,"children":6156},{"style":546},[6157],{"type":49,"value":5876},{"type":43,"tag":539,"props":6159,"children":6160},{"class":541,"line":745},[6161,6166,6170,6174,6178],{"type":43,"tag":539,"props":6162,"children":6163},{"style":800},[6164],{"type":49,"value":6165},"  avatarId",{"type":43,"tag":539,"props":6167,"children":6168},{"style":766},[6169],{"type":49,"value":813},{"type":43,"tag":539,"props":6171,"children":6172},{"style":766},[6173],{"type":49,"value":5893},{"type":43,"tag":539,"props":6175,"children":6176},{"style":552},[6177],{"type":49,"value":5898},{"type":43,"tag":539,"props":6179,"children":6180},{"style":766},[6181],{"type":49,"value":5903},{"type":43,"tag":539,"props":6183,"children":6184},{"class":541,"line":786},[6185,6190,6194,6198,6202],{"type":43,"tag":539,"props":6186,"children":6187},{"style":800},[6188],{"type":49,"value":6189},"  connectUrl",{"type":43,"tag":539,"props":6191,"children":6192},{"style":766},[6193],{"type":49,"value":813},{"type":43,"tag":539,"props":6195,"children":6196},{"style":766},[6197],{"type":49,"value":5893},{"type":43,"tag":539,"props":6199,"children":6200},{"style":552},[6201],{"type":49,"value":3764},{"type":43,"tag":539,"props":6203,"children":6204},{"style":766},[6205],{"type":49,"value":5903},{"type":43,"tag":539,"props":6207,"children":6208},{"class":541,"line":796},[6209,6214,6218,6222,6226,6230],{"type":43,"tag":539,"props":6210,"children":6211},{"style":800},[6212],{"type":49,"value":6213},"  onError",{"type":43,"tag":539,"props":6215,"children":6216},{"style":766},[6217],{"type":49,"value":5995},{"type":43,"tag":539,"props":6219,"children":6220},{"style":2172},[6221],{"type":49,"value":5074},{"type":43,"tag":539,"props":6223,"children":6224},{"style":766},[6225],{"type":49,"value":481},{"type":43,"tag":539,"props":6227,"children":6228},{"style":800},[6229],{"type":49,"value":2899},{"type":43,"tag":539,"props":6231,"children":6232},{"style":766},[6233],{"type":49,"value":978},{"type":43,"tag":539,"props":6235,"children":6236},{"class":541,"line":836},[6237,6241,6245,6249,6253,6257,6262,6266,6270,6274,6278],{"type":43,"tag":539,"props":6238,"children":6239},{"style":755},[6240],{"type":49,"value":5091},{"type":43,"tag":539,"props":6242,"children":6243},{"style":766},[6244],{"type":49,"value":873},{"type":43,"tag":539,"props":6246,"children":6247},{"style":821},[6248],{"type":49,"value":5074},{"type":43,"tag":539,"props":6250,"children":6251},{"style":904},[6252],{"type":49,"value":892},{"type":43,"tag":539,"props":6254,"children":6255},{"style":766},[6256],{"type":49,"value":778},{"type":43,"tag":539,"props":6258,"children":6259},{"style":552},[6260],{"type":49,"value":6261},"Avatar error:",{"type":43,"tag":539,"props":6263,"children":6264},{"style":766},[6265],{"type":49,"value":778},{"type":43,"tag":539,"props":6267,"children":6268},{"style":766},[6269],{"type":49,"value":1141},{"type":43,"tag":539,"props":6271,"children":6272},{"style":755},[6273],{"type":49,"value":2800},{"type":43,"tag":539,"props":6275,"children":6276},{"style":904},[6277],{"type":49,"value":481},{"type":43,"tag":539,"props":6279,"children":6280},{"style":766},[6281],{"type":49,"value":783},{"type":43,"tag":539,"props":6283,"children":6284},{"class":541,"line":844},[6285,6289,6293,6297,6301,6305,6310,6314,6318,6322,6326,6331,6335],{"type":43,"tag":539,"props":6286,"children":6287},{"style":755},[6288],{"type":49,"value":5091},{"type":43,"tag":539,"props":6290,"children":6291},{"style":766},[6292],{"type":49,"value":873},{"type":43,"tag":539,"props":6294,"children":6295},{"style":821},[6296],{"type":49,"value":5074},{"type":43,"tag":539,"props":6298,"children":6299},{"style":904},[6300],{"type":49,"value":892},{"type":43,"tag":539,"props":6302,"children":6303},{"style":766},[6304],{"type":49,"value":778},{"type":43,"tag":539,"props":6306,"children":6307},{"style":552},[6308],{"type":49,"value":6309},"Error name:",{"type":43,"tag":539,"props":6311,"children":6312},{"style":766},[6313],{"type":49,"value":778},{"type":43,"tag":539,"props":6315,"children":6316},{"style":766},[6317],{"type":49,"value":1141},{"type":43,"tag":539,"props":6319,"children":6320},{"style":755},[6321],{"type":49,"value":2800},{"type":43,"tag":539,"props":6323,"children":6324},{"style":766},[6325],{"type":49,"value":873},{"type":43,"tag":539,"props":6327,"children":6328},{"style":755},[6329],{"type":49,"value":6330},"name",{"type":43,"tag":539,"props":6332,"children":6333},{"style":904},[6334],{"type":49,"value":481},{"type":43,"tag":539,"props":6336,"children":6337},{"style":766},[6338],{"type":49,"value":783},{"type":43,"tag":539,"props":6340,"children":6341},{"class":541,"line":900},[6342,6346,6350,6354,6358,6362,6367,6371,6375,6379,6383,6387,6391],{"type":43,"tag":539,"props":6343,"children":6344},{"style":755},[6345],{"type":49,"value":5091},{"type":43,"tag":539,"props":6347,"children":6348},{"style":766},[6349],{"type":49,"value":873},{"type":43,"tag":539,"props":6351,"children":6352},{"style":821},[6353],{"type":49,"value":5074},{"type":43,"tag":539,"props":6355,"children":6356},{"style":904},[6357],{"type":49,"value":892},{"type":43,"tag":539,"props":6359,"children":6360},{"style":766},[6361],{"type":49,"value":778},{"type":43,"tag":539,"props":6363,"children":6364},{"style":552},[6365],{"type":49,"value":6366},"Error message:",{"type":43,"tag":539,"props":6368,"children":6369},{"style":766},[6370],{"type":49,"value":778},{"type":43,"tag":539,"props":6372,"children":6373},{"style":766},[6374],{"type":49,"value":1141},{"type":43,"tag":539,"props":6376,"children":6377},{"style":755},[6378],{"type":49,"value":2800},{"type":43,"tag":539,"props":6380,"children":6381},{"style":766},[6382],{"type":49,"value":873},{"type":43,"tag":539,"props":6384,"children":6385},{"style":755},[6386],{"type":49,"value":5216},{"type":43,"tag":539,"props":6388,"children":6389},{"style":904},[6390],{"type":49,"value":481},{"type":43,"tag":539,"props":6392,"children":6393},{"style":766},[6394],{"type":49,"value":783},{"type":43,"tag":539,"props":6396,"children":6397},{"class":541,"line":933},[6398,6402,6406,6410,6414,6419,6423,6427,6431,6435,6439,6443,6448,6452,6456,6460,6464,6468,6472],{"type":43,"tag":539,"props":6399,"children":6400},{"style":749},[6401],{"type":49,"value":2622},{"type":43,"tag":539,"props":6403,"children":6404},{"style":904},[6405],{"type":49,"value":493},{"type":43,"tag":539,"props":6407,"children":6408},{"style":755},[6409],{"type":49,"value":5074},{"type":43,"tag":539,"props":6411,"children":6412},{"style":766},[6413],{"type":49,"value":873},{"type":43,"tag":539,"props":6415,"children":6416},{"style":755},[6417],{"type":49,"value":6418},"cause",{"type":43,"tag":539,"props":6420,"children":6421},{"style":904},[6422],{"type":49,"value":2541},{"type":43,"tag":539,"props":6424,"children":6425},{"style":755},[6426],{"type":49,"value":1110},{"type":43,"tag":539,"props":6428,"children":6429},{"style":766},[6430],{"type":49,"value":873},{"type":43,"tag":539,"props":6432,"children":6433},{"style":821},[6434],{"type":49,"value":5074},{"type":43,"tag":539,"props":6436,"children":6437},{"style":904},[6438],{"type":49,"value":892},{"type":43,"tag":539,"props":6440,"children":6441},{"style":766},[6442],{"type":49,"value":778},{"type":43,"tag":539,"props":6444,"children":6445},{"style":552},[6446],{"type":49,"value":6447},"Cause:",{"type":43,"tag":539,"props":6449,"children":6450},{"style":766},[6451],{"type":49,"value":778},{"type":43,"tag":539,"props":6453,"children":6454},{"style":766},[6455],{"type":49,"value":1141},{"type":43,"tag":539,"props":6457,"children":6458},{"style":755},[6459],{"type":49,"value":2800},{"type":43,"tag":539,"props":6461,"children":6462},{"style":766},[6463],{"type":49,"value":873},{"type":43,"tag":539,"props":6465,"children":6466},{"style":755},[6467],{"type":49,"value":6418},{"type":43,"tag":539,"props":6469,"children":6470},{"style":904},[6471],{"type":49,"value":481},{"type":43,"tag":539,"props":6473,"children":6474},{"style":766},[6475],{"type":49,"value":783},{"type":43,"tag":539,"props":6477,"children":6478},{"class":541,"line":963},[6479],{"type":43,"tag":539,"props":6480,"children":6481},{"style":766},[6482],{"type":49,"value":6483},"  }}\n",{"type":43,"tag":539,"props":6485,"children":6486},{"class":541,"line":981},[6487],{"type":43,"tag":539,"props":6488,"children":6489},{"style":766},[6490],{"type":49,"value":6491},"\u002F>\n",{"type":43,"tag":185,"props":6493,"children":6495},{"id":6494},"monitor-session-state",[6496],{"type":49,"value":6497},"Monitor session state",{"type":43,"tag":263,"props":6499,"children":6501},{"className":5724,"code":6500,"language":5726,"meta":271,"style":271},"import { useAvatarSession } from '@runwayml\u002Favatars-react';\n\nfunction DebugInfo() {\n  const { state, sessionId, error } = useAvatarSession();\n  return (\n    \u003Cpre>\n      {JSON.stringify({ state, sessionId, error: error?.message }, null, 2)}\n    \u003C\u002Fpre>\n  );\n}\n",[6502],{"type":43,"tag":74,"props":6503,"children":6504},{"__ignoreMap":271},[6505,6545,6552,6573,6625,6636,6652,6743,6759,6770],{"type":43,"tag":539,"props":6506,"children":6507},{"class":541,"line":542},[6508,6512,6516,6521,6525,6529,6533,6537,6541],{"type":43,"tag":539,"props":6509,"children":6510},{"style":749},[6511],{"type":49,"value":752},{"type":43,"tag":539,"props":6513,"children":6514},{"style":766},[6515],{"type":49,"value":1579},{"type":43,"tag":539,"props":6517,"children":6518},{"style":755},[6519],{"type":49,"value":6520}," useAvatarSession",{"type":43,"tag":539,"props":6522,"children":6523},{"style":766},[6524],{"type":49,"value":2214},{"type":43,"tag":539,"props":6526,"children":6527},{"style":749},[6528],{"type":49,"value":5775},{"type":43,"tag":539,"props":6530,"children":6531},{"style":766},[6532],{"type":49,"value":769},{"type":43,"tag":539,"props":6534,"children":6535},{"style":552},[6536],{"type":49,"value":588},{"type":43,"tag":539,"props":6538,"children":6539},{"style":766},[6540],{"type":49,"value":778},{"type":43,"tag":539,"props":6542,"children":6543},{"style":766},[6544],{"type":49,"value":783},{"type":43,"tag":539,"props":6546,"children":6547},{"class":541,"line":745},[6548],{"type":43,"tag":539,"props":6549,"children":6550},{"emptyLinePlaceholder":790},[6551],{"type":49,"value":793},{"type":43,"tag":539,"props":6553,"children":6554},{"class":541,"line":786},[6555,6560,6565,6569],{"type":43,"tag":539,"props":6556,"children":6557},{"style":800},[6558],{"type":49,"value":6559},"function",{"type":43,"tag":539,"props":6561,"children":6562},{"style":821},[6563],{"type":49,"value":6564}," DebugInfo",{"type":43,"tag":539,"props":6566,"children":6567},{"style":766},[6568],{"type":49,"value":829},{"type":43,"tag":539,"props":6570,"children":6571},{"style":766},[6572],{"type":49,"value":978},{"type":43,"tag":539,"props":6574,"children":6575},{"class":541,"line":796},[6576,6580,6584,6589,6593,6597,6601,6605,6609,6613,6617,6621],{"type":43,"tag":539,"props":6577,"children":6578},{"style":800},[6579],{"type":49,"value":2200},{"type":43,"tag":539,"props":6581,"children":6582},{"style":766},[6583],{"type":49,"value":1579},{"type":43,"tag":539,"props":6585,"children":6586},{"style":755},[6587],{"type":49,"value":6588}," state",{"type":43,"tag":539,"props":6590,"children":6591},{"style":766},[6592],{"type":49,"value":1141},{"type":43,"tag":539,"props":6594,"children":6595},{"style":755},[6596],{"type":49,"value":2285},{"type":43,"tag":539,"props":6598,"children":6599},{"style":766},[6600],{"type":49,"value":1141},{"type":43,"tag":539,"props":6602,"children":6603},{"style":755},[6604],{"type":49,"value":2800},{"type":43,"tag":539,"props":6606,"children":6607},{"style":766},[6608],{"type":49,"value":2214},{"type":43,"tag":539,"props":6610,"children":6611},{"style":766},[6612],{"type":49,"value":2219},{"type":43,"tag":539,"props":6614,"children":6615},{"style":821},[6616],{"type":49,"value":6520},{"type":43,"tag":539,"props":6618,"children":6619},{"style":904},[6620],{"type":49,"value":829},{"type":43,"tag":539,"props":6622,"children":6623},{"style":766},[6624],{"type":49,"value":783},{"type":43,"tag":539,"props":6626,"children":6627},{"class":541,"line":836},[6628,6632],{"type":43,"tag":539,"props":6629,"children":6630},{"style":749},[6631],{"type":49,"value":3397},{"type":43,"tag":539,"props":6633,"children":6634},{"style":904},[6635],{"type":49,"value":5863},{"type":43,"tag":539,"props":6637,"children":6638},{"class":541,"line":844},[6639,6643,6647],{"type":43,"tag":539,"props":6640,"children":6641},{"style":766},[6642],{"type":49,"value":5871},{"type":43,"tag":539,"props":6644,"children":6645},{"style":904},[6646],{"type":49,"value":263},{"type":43,"tag":539,"props":6648,"children":6649},{"style":766},[6650],{"type":49,"value":6651},">\n",{"type":43,"tag":539,"props":6653,"children":6654},{"class":541,"line":900},[6655,6660,6665,6669,6674,6678,6682,6686,6690,6694,6698,6702,6706,6710,6715,6720,6725,6730,6735,6739],{"type":43,"tag":539,"props":6656,"children":6657},{"style":766},[6658],{"type":49,"value":6659},"      {",{"type":43,"tag":539,"props":6661,"children":6662},{"style":755},[6663],{"type":49,"value":6664},"JSON",{"type":43,"tag":539,"props":6666,"children":6667},{"style":766},[6668],{"type":49,"value":873},{"type":43,"tag":539,"props":6670,"children":6671},{"style":821},[6672],{"type":49,"value":6673},"stringify",{"type":43,"tag":539,"props":6675,"children":6676},{"style":755},[6677],{"type":49,"value":892},{"type":43,"tag":539,"props":6679,"children":6680},{"style":766},[6681],{"type":49,"value":2795},{"type":43,"tag":539,"props":6683,"children":6684},{"style":755},[6685],{"type":49,"value":6588},{"type":43,"tag":539,"props":6687,"children":6688},{"style":766},[6689],{"type":49,"value":1141},{"type":43,"tag":539,"props":6691,"children":6692},{"style":755},[6693],{"type":49,"value":2285},{"type":43,"tag":539,"props":6695,"children":6696},{"style":766},[6697],{"type":49,"value":1141},{"type":43,"tag":539,"props":6699,"children":6700},{"style":904},[6701],{"type":49,"value":2800},{"type":43,"tag":539,"props":6703,"children":6704},{"style":766},[6705],{"type":49,"value":912},{"type":43,"tag":539,"props":6707,"children":6708},{"style":755},[6709],{"type":49,"value":2800},{"type":43,"tag":539,"props":6711,"children":6712},{"style":766},[6713],{"type":49,"value":6714},"?.",{"type":43,"tag":539,"props":6716,"children":6717},{"style":755},[6718],{"type":49,"value":6719},"message ",{"type":43,"tag":539,"props":6721,"children":6722},{"style":766},[6723],{"type":49,"value":6724},"},",{"type":43,"tag":539,"props":6726,"children":6727},{"style":766},[6728],{"type":49,"value":6729}," null,",{"type":43,"tag":539,"props":6731,"children":6732},{"style":2501},[6733],{"type":49,"value":6734}," 2",{"type":43,"tag":539,"props":6736,"children":6737},{"style":755},[6738],{"type":49,"value":481},{"type":43,"tag":539,"props":6740,"children":6741},{"style":766},[6742],{"type":49,"value":3545},{"type":43,"tag":539,"props":6744,"children":6745},{"class":541,"line":933},[6746,6751,6755],{"type":43,"tag":539,"props":6747,"children":6748},{"style":766},[6749],{"type":49,"value":6750},"    \u003C\u002F",{"type":43,"tag":539,"props":6752,"children":6753},{"style":904},[6754],{"type":49,"value":263},{"type":43,"tag":539,"props":6756,"children":6757},{"style":766},[6758],{"type":49,"value":6651},{"type":43,"tag":539,"props":6760,"children":6761},{"class":541,"line":963},[6762,6766],{"type":43,"tag":539,"props":6763,"children":6764},{"style":904},[6765],{"type":49,"value":3335},{"type":43,"tag":539,"props":6767,"children":6768},{"style":766},[6769],{"type":49,"value":783},{"type":43,"tag":539,"props":6771,"children":6772},{"class":541,"line":981},[6773],{"type":43,"tag":539,"props":6774,"children":6775},{"style":766},[6776],{"type":49,"value":3545},{"type":43,"tag":185,"props":6778,"children":6780},{"id":6779},"test-with-minimal-setup",[6781],{"type":49,"value":6782},"Test with minimal setup",{"type":43,"tag":263,"props":6784,"children":6786},{"className":531,"code":6785,"language":533,"meta":271,"style":271},"npx degit runwayml\u002Favatars-sdk-react\u002Fexamples\u002Fnextjs-simple test-app\ncd test-app\nnpm install\n# Add your API key to .env.local\nnpm run dev\n",[6787],{"type":43,"tag":74,"props":6788,"children":6789},{"__ignoreMap":271},[6790,6813,6825,6837,6845],{"type":43,"tag":539,"props":6791,"children":6792},{"class":541,"line":542},[6793,6798,6803,6808],{"type":43,"tag":539,"props":6794,"children":6795},{"style":546},[6796],{"type":49,"value":6797},"npx",{"type":43,"tag":539,"props":6799,"children":6800},{"style":552},[6801],{"type":49,"value":6802}," degit",{"type":43,"tag":539,"props":6804,"children":6805},{"style":552},[6806],{"type":49,"value":6807}," runwayml\u002Favatars-sdk-react\u002Fexamples\u002Fnextjs-simple",{"type":43,"tag":539,"props":6809,"children":6810},{"style":552},[6811],{"type":49,"value":6812}," test-app\n",{"type":43,"tag":539,"props":6814,"children":6815},{"class":541,"line":745},[6816,6821],{"type":43,"tag":539,"props":6817,"children":6818},{"style":821},[6819],{"type":49,"value":6820},"cd",{"type":43,"tag":539,"props":6822,"children":6823},{"style":552},[6824],{"type":49,"value":6812},{"type":43,"tag":539,"props":6826,"children":6827},{"class":541,"line":786},[6828,6832],{"type":43,"tag":539,"props":6829,"children":6830},{"style":546},[6831],{"type":49,"value":549},{"type":43,"tag":539,"props":6833,"children":6834},{"style":552},[6835],{"type":49,"value":6836}," install\n",{"type":43,"tag":539,"props":6838,"children":6839},{"class":541,"line":796},[6840],{"type":43,"tag":539,"props":6841,"children":6842},{"style":739},[6843],{"type":49,"value":6844},"# Add your API key to .env.local\n",{"type":43,"tag":539,"props":6846,"children":6847},{"class":541,"line":836},[6848,6852,6857],{"type":43,"tag":539,"props":6849,"children":6850},{"style":546},[6851],{"type":49,"value":549},{"type":43,"tag":539,"props":6853,"children":6854},{"style":552},[6855],{"type":49,"value":6856}," run",{"type":43,"tag":539,"props":6858,"children":6859},{"style":552},[6860],{"type":49,"value":6861}," dev\n",{"type":43,"tag":178,"props":6863,"children":6865},{"id":6864},"browser-support",[6866],{"type":49,"value":6867},"Browser Support",{"type":43,"tag":192,"props":6869,"children":6870},{},[6871,6887],{"type":43,"tag":196,"props":6872,"children":6873},{},[6874],{"type":43,"tag":200,"props":6875,"children":6876},{},[6877,6882],{"type":43,"tag":204,"props":6878,"children":6879},{},[6880],{"type":49,"value":6881},"Browser",{"type":43,"tag":204,"props":6883,"children":6884},{},[6885],{"type":49,"value":6886},"Minimum Version",{"type":43,"tag":215,"props":6888,"children":6889},{},[6890,6903,6916,6929],{"type":43,"tag":200,"props":6891,"children":6892},{},[6893,6898],{"type":43,"tag":222,"props":6894,"children":6895},{},[6896],{"type":49,"value":6897},"Chrome",{"type":43,"tag":222,"props":6899,"children":6900},{},[6901],{"type":49,"value":6902},"74+",{"type":43,"tag":200,"props":6904,"children":6905},{},[6906,6911],{"type":43,"tag":222,"props":6907,"children":6908},{},[6909],{"type":49,"value":6910},"Firefox",{"type":43,"tag":222,"props":6912,"children":6913},{},[6914],{"type":49,"value":6915},"78+",{"type":43,"tag":200,"props":6917,"children":6918},{},[6919,6924],{"type":43,"tag":222,"props":6920,"children":6921},{},[6922],{"type":49,"value":6923},"Safari",{"type":43,"tag":222,"props":6925,"children":6926},{},[6927],{"type":49,"value":6928},"14.1+",{"type":43,"tag":200,"props":6930,"children":6931},{},[6932,6937],{"type":43,"tag":222,"props":6933,"children":6934},{},[6935],{"type":49,"value":6936},"Edge",{"type":43,"tag":222,"props":6938,"children":6939},{},[6940],{"type":49,"value":6941},"79+",{"type":43,"tag":56,"props":6943,"children":6944},{},[6945],{"type":49,"value":6946},"Users must grant microphone permissions. Camera permissions needed if user video is enabled.",{"type":43,"tag":178,"props":6948,"children":6950},{"id":6949},"getting-help",[6951],{"type":49,"value":6952},"Getting Help",{"type":43,"tag":192,"props":6954,"children":6955},{},[6956,6971],{"type":43,"tag":196,"props":6957,"children":6958},{},[6959],{"type":43,"tag":200,"props":6960,"children":6961},{},[6962,6967],{"type":43,"tag":204,"props":6963,"children":6964},{},[6965],{"type":49,"value":6966},"Resource",{"type":43,"tag":204,"props":6968,"children":6969},{},[6970],{"type":49,"value":213},{"type":43,"tag":215,"props":6972,"children":6973},{},[6974,6990],{"type":43,"tag":200,"props":6975,"children":6976},{},[6977,6985],{"type":43,"tag":222,"props":6978,"children":6979},{},[6980],{"type":43,"tag":94,"props":6981,"children":6983},{"href":635,"rel":6982},[98],[6984],{"type":49,"value":606},{"type":43,"tag":222,"props":6986,"children":6987},{},[6988],{"type":49,"value":6989},"Manage avatars, view logs, access dashboard",{"type":43,"tag":200,"props":6991,"children":6992},{},[6993,7003],{"type":43,"tag":222,"props":6994,"children":6995},{},[6996],{"type":43,"tag":94,"props":6997,"children":7000},{"href":6998,"rel":6999},"https:\u002F\u002Fgithub.com\u002Frunwayml\u002Favatars-sdk-react",[98],[7001],{"type":49,"value":7002},"SDK Repository",{"type":43,"tag":222,"props":7004,"children":7005},{},[7006],{"type":49,"value":7007},"Report bugs, view examples, check releases",{"type":43,"tag":56,"props":7009,"children":7010},{},[7011,7013,7019],{"type":49,"value":7012},"When reporting issues, include: browser\u002Fversion, SDK version (",{"type":43,"tag":74,"props":7014,"children":7016},{"className":7015},[],[7017],{"type":49,"value":7018},"npm list @runwayml\u002Favatars-react",{"type":49,"value":7020},"), error messages, session ID, and steps to reproduce.",{"type":43,"tag":7022,"props":7023,"children":7024},"style",{},[7025],{"type":49,"value":7026},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":7028,"total":2474},[7029,7046,7055,7069,7084,7095,7108],{"slug":7030,"name":7030,"fn":7031,"description":7032,"org":7033,"tags":7034,"stars":24,"repoUrl":25,"updatedAt":7045},"rw-api-reference","look up Runway API reference","Complete reference for Runway's public API: models, endpoints, costs, limits, and types",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7035,7038,7039,7042],{"name":7036,"slug":7037,"type":16},"AI Infrastructure","ai-infrastructure",{"name":22,"slug":23,"type":16},{"name":7040,"slug":7041,"type":16},"Reference","reference",{"name":7043,"slug":7044,"type":16},"Video","video","2026-04-08T04:41:58.820783",{"slug":7047,"name":7047,"fn":7048,"description":7049,"org":7050,"tags":7051,"stars":24,"repoUrl":25,"updatedAt":7054},"rw-check-compatibility","verify codebase compatibility with the Runway API","Analyze a user's codebase to verify it can use Runway's public API (server-side requirement)",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7052,7053],{"name":22,"slug":23,"type":16},{"name":9,"slug":8,"type":16},"2026-04-08T04:42:01.271257",{"slug":7056,"name":7056,"fn":7057,"description":7058,"org":7059,"tags":7060,"stars":24,"repoUrl":25,"updatedAt":7068},"rw-check-org-details","query Runway API for organization details","Query the Runway API for organization details: rate limits, credit balance, usage tier, and daily generation counts",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7061,7064,7067],{"name":7062,"slug":7063,"type":16},"Operations","operations",{"name":7065,"slug":7066,"type":16},"Reporting","reporting",{"name":9,"slug":8,"type":16},"2026-04-08T04:42:00.054235",{"slug":7070,"name":7070,"fn":7071,"description":7072,"org":7073,"tags":7074,"stars":24,"repoUrl":25,"updatedAt":7083},"rw-fetch-api-reference","retrieve Runway API reference","Retrieve the latest Runway API reference from docs.dev.runwayml.com and use it as the authoritative source before any integration work",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7075,7076,7079,7082],{"name":22,"slug":23,"type":16},{"name":7077,"slug":7078,"type":16},"Documentation","documentation",{"name":7080,"slug":7081,"type":16},"Research","research",{"name":9,"slug":8,"type":16},"2026-04-08T04:42:07.604739",{"slug":7085,"name":7085,"fn":7086,"description":7087,"org":7088,"tags":7089,"stars":24,"repoUrl":25,"updatedAt":7094},"rw-generate-audio","generate audio with Runway API","Generate audio using the Runway API via runnable scripts. Supports TTS, sound effects, voice isolation, dubbing, and voice conversion.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7090,7091,7092,7093],{"name":7036,"slug":7037,"type":16},{"name":19,"slug":20,"type":16},{"name":14,"slug":15,"type":16},{"name":9,"slug":8,"type":16},"2026-04-17T04:51:59.892185",{"slug":7096,"name":7096,"fn":7097,"description":7098,"org":7099,"tags":7100,"stars":24,"repoUrl":25,"updatedAt":7107},"rw-generate-image","generate images with Runway API","Generate images directly using the Runway API via runnable scripts. Supports text-to-image with optional reference images.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7101,7102,7103,7106],{"name":7036,"slug":7037,"type":16},{"name":14,"slug":15,"type":16},{"name":7104,"slug":7105,"type":16},"Image Generation","image-generation",{"name":9,"slug":8,"type":16},"2026-04-17T04:52:01.158325",{"slug":7109,"name":7109,"fn":7110,"description":7111,"org":7112,"tags":7113,"stars":24,"repoUrl":25,"updatedAt":7118},"rw-generate-video","generate videos with Runway API","Generate videos directly using the Runway API via runnable scripts. Supports text-to-video, image-to-video, and video-to-video with seedance2, gen4.5, veo3, and more.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7114,7115,7116,7117],{"name":7036,"slug":7037,"type":16},{"name":14,"slug":15,"type":16},{"name":9,"slug":8,"type":16},{"name":7043,"slug":7044,"type":16},"2026-04-17T04:51:58.600919",{"items":7120,"total":2548},[7121,7128,7133,7139,7146,7153,7160,7167,7181,7199,7206,7226],{"slug":7030,"name":7030,"fn":7031,"description":7032,"org":7122,"tags":7123,"stars":24,"repoUrl":25,"updatedAt":7045},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7124,7125,7126,7127],{"name":7036,"slug":7037,"type":16},{"name":22,"slug":23,"type":16},{"name":7040,"slug":7041,"type":16},{"name":7043,"slug":7044,"type":16},{"slug":7047,"name":7047,"fn":7048,"description":7049,"org":7129,"tags":7130,"stars":24,"repoUrl":25,"updatedAt":7054},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7131,7132],{"name":22,"slug":23,"type":16},{"name":9,"slug":8,"type":16},{"slug":7056,"name":7056,"fn":7057,"description":7058,"org":7134,"tags":7135,"stars":24,"repoUrl":25,"updatedAt":7068},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7136,7137,7138],{"name":7062,"slug":7063,"type":16},{"name":7065,"slug":7066,"type":16},{"name":9,"slug":8,"type":16},{"slug":7070,"name":7070,"fn":7071,"description":7072,"org":7140,"tags":7141,"stars":24,"repoUrl":25,"updatedAt":7083},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7142,7143,7144,7145],{"name":22,"slug":23,"type":16},{"name":7077,"slug":7078,"type":16},{"name":7080,"slug":7081,"type":16},{"name":9,"slug":8,"type":16},{"slug":7085,"name":7085,"fn":7086,"description":7087,"org":7147,"tags":7148,"stars":24,"repoUrl":25,"updatedAt":7094},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7149,7150,7151,7152],{"name":7036,"slug":7037,"type":16},{"name":19,"slug":20,"type":16},{"name":14,"slug":15,"type":16},{"name":9,"slug":8,"type":16},{"slug":7096,"name":7096,"fn":7097,"description":7098,"org":7154,"tags":7155,"stars":24,"repoUrl":25,"updatedAt":7107},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7156,7157,7158,7159],{"name":7036,"slug":7037,"type":16},{"name":14,"slug":15,"type":16},{"name":7104,"slug":7105,"type":16},{"name":9,"slug":8,"type":16},{"slug":7109,"name":7109,"fn":7110,"description":7111,"org":7161,"tags":7162,"stars":24,"repoUrl":25,"updatedAt":7118},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7163,7164,7165,7166],{"name":7036,"slug":7037,"type":16},{"name":14,"slug":15,"type":16},{"name":9,"slug":8,"type":16},{"name":7043,"slug":7044,"type":16},{"slug":7168,"name":7168,"fn":7169,"description":7170,"org":7171,"tags":7172,"stars":24,"repoUrl":25,"updatedAt":7180},"rw-integrate-audio","integrate Runway audio APIs","Help users integrate Runway audio APIs (TTS, sound effects, voice isolation, dubbing)",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7173,7174,7175,7176,7177],{"name":22,"slug":23,"type":16},{"name":19,"slug":20,"type":16},{"name":14,"slug":15,"type":16},{"name":9,"slug":8,"type":16},{"name":7178,"slug":7179,"type":16},"Speech","speech","2026-04-08T04:42:10.081814",{"slug":7182,"name":7182,"fn":7183,"description":7184,"org":7185,"tags":7186,"stars":24,"repoUrl":25,"updatedAt":7198},"rw-integrate-character-embed","embed Runway characters in React apps","Help users embed Runway Character avatar calls in React apps using the @runwayml\u002Favatars-react SDK",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7187,7188,7191,7194,7195],{"name":22,"slug":23,"type":16},{"name":7189,"slug":7190,"type":16},"Frontend","frontend",{"name":7192,"slug":7193,"type":16},"React","react",{"name":9,"slug":8,"type":16},{"name":7196,"slug":7197,"type":16},"UI Components","ui-components","2026-04-08T04:42:08.849481",{"slug":4,"name":4,"fn":5,"description":6,"org":7200,"tags":7201,"stars":24,"repoUrl":25,"updatedAt":26},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7202,7203,7204,7205],{"name":22,"slug":23,"type":16},{"name":19,"slug":20,"type":16},{"name":14,"slug":15,"type":16},{"name":9,"slug":8,"type":16},{"slug":7207,"name":7207,"fn":7208,"description":7209,"org":7210,"tags":7211,"stars":24,"repoUrl":25,"updatedAt":7225},"rw-integrate-documents","add documents to Runway Characters","Help users add knowledge base documents to Runway Characters for domain-specific conversations",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7212,7215,7218,7221,7224],{"name":7213,"slug":7214,"type":16},"Agents","agents",{"name":7216,"slug":7217,"type":16},"AI Context","ai-context",{"name":7219,"slug":7220,"type":16},"Documents","documents",{"name":7222,"slug":7223,"type":16},"Knowledge Management","knowledge-management",{"name":9,"slug":8,"type":16},"2026-04-08T04:42:04.95186",{"slug":7227,"name":7227,"fn":7228,"description":7229,"org":7230,"tags":7231,"stars":24,"repoUrl":25,"updatedAt":7236},"rw-integrate-image","integrate Runway image generation APIs","Help users integrate Runway image generation APIs (text-to-image with reference images)",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[7232,7233,7234,7235],{"name":22,"slug":23,"type":16},{"name":14,"slug":15,"type":16},{"name":7104,"slug":7105,"type":16},{"name":9,"slug":8,"type":16},"2026-04-08T04:42:11.322008"]