# STT from livekit inference and assembly AI returning error

**URL:** <https://community.livekit.io/t/stt-from-livekit-inference-and-assembly-ai-returning-error/936>\
**Category:** Getting Started\
**Created:** [April 23, 2026, 6:16am UTC](https://community.livekit.io/t/stt-from-livekit-inference-and-assembly-ai-returning-error/936 "2026-04-23T06:16:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ai-interviewer](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@ai-interviewer](https://community.livekit.io/u/ai-interviewer)\
**Post date:** [April 23, 2026, 6:16am UTC](https://community.livekit.io/t/stt-from-livekit-inference-and-assembly-ai-returning-error/936/1 "2026-04-23T06:16:53Z")

</div>

Hey team,

We are seeing a surge in this error, this causes the session to get stuck, and eventually end.

Attaching an example log -

agentId:CA\_twTMjpNUeaEj  
entity.guid:MzExMDU2M3xBUE18QVBQTElDQVRJT058MTY4MDI5OTkyMw  
entity.guids:MzExMDU2M3xBUE18QVBQTElDQVRJT058MTY4MDI5OTkyMw  
entity.name:livekit.hosted.agents  
exc\_info:Traceback (most recent call last):  
File “/app/.venv/lib/python3.13/site-packages/livekit/agents/utils/log.py”, line 17, in async\_fn\_logs  
return await fn(\*args, \*\*kwargs)  
^^^^^^^^^^^^^^^^^^^^^^^^^  
File “/app/.venv/lib/python3.13/site-packages/livekit/agents/inference/stt.py”, line 602, in recv\_task  
raise APIError(f"LiveKit Inference STT returned error: {msg.data}")  
livekit.agents.\_exceptions.APIError: LiveKit Inference STT returned error: {“type”:“error”,“session\_id”:“e35d2c9d-1147-4f7c-a312-c4a02556b7f1”,“message”:“session closed due to agent inactivity”,“code”:2007}

We are using assembly AI Through livekit’s inference for STT

---

<div class="post-metadata">

**Author:** ![CWilson](https://sea1.discourse-cdn.com/flex001/user_avatar/community.livekit.io/cwilson/32/135_2.png) [@CWilson](https://community.livekit.io/u/CWilson)\
**Post date:** [April 23, 2026, 11:30am UTC](https://community.livekit.io/t/stt-from-livekit-inference-and-assembly-ai-returning-error/936/2 "2026-04-23T11:30:54Z")

</div>

Have you tried to adjust `inactivity_timeout`If you have Agent Insights enabled, can you see if this occurred during a long period of silence?

Also, make sure you do not have any code that would block the STT thread.
