#In conversational ai (agents platform), How to I send the current conversation id to the custom llm
1 messages · Page 1 of 1 (latest)
Short answer: there isn’t a documented switch that automatically injects ElevenLabs’ conversation_id into the body your custom LLM endpoint receives. The two supported, documented options are:
-
Put the conversation ID into the messages your server receives:
- Add {{ system__conversation_id }} to your agent’s system prompt (or first message). Dynamic variables are resolved by ElevenLabs and the resulting text is sent in the OpenAI-compatible messages array delivered to your custom LLM server. (elevenlabs.io)
-
Pass your own correlation ID as a parameter (if you need a separate field):
- ElevenLabs will forward user_id and any elevenlabs_extra_body/custom_llm_extra_body you provide at session start to your custom LLM in the request body (e.g., user_id and elevenlabs_extra_body fields). You can use these to carry a client-generated ID. The sample custom LLM server shows user_id being forwarded; extra body is included when “Custom LLM extra body” is enabled. (elevenlabs.io)
How to obtain the current conversation ID at runtime:
- Read it from the conversation_initiation_metadata event (conversation_id field) or via conversation.getId() in the JS Client/React SDK after the session starts. (elevenlabs.io)
Note: The docs show setting custom_llm_extra_body only at conversation initiation; they do not document updating that payload after the conversation_id becomes available. If you specifically need the ElevenLabs-generated conversation_id at your server, the documented path is to include {{ system__conversation_id }} in the prompt so it arrives in the messages your endpoint receives. (elevenlabs.io)
Sources:
Dynamic variables | ElevenLabs Documentation
Integrate your own model | ElevenLabs Documentation
Client events | ElevenLabs Documentation
Agent WebSockets | ElevenLabs Documentation
can I override the conversation id set by eleven labs by my own id provided through the custom llm body?
Short answer: No.
- ElevenLabs generates the conversation_id and exposes it to you (e.g., via the WebSocket initiation metadata and as the system__conversation_id dynamic variable). There is no documented mechanism to override or replace it. (elevenlabs.io)
- The Custom LLM “extra body” (elevenlabs_extra_body / custom_llm_extra_body) is simply forwarded to your LLM in the OpenAI-style request; it does not affect ElevenLabs’ conversation_id. (elevenlabs.io)
What you can do instead
- Pass your own identifier as user_id when starting the session (or inside conversation_initiation_client_data). This value is stored with the conversation and is retrievable later. (elevenlabs.io)
- If you also want your LLM to see your external ID, include it in the Custom LLM extra body you send. (elevenlabs.io)
Relevant docs:
- Agent WebSockets message schema (shows conversation_id and custom_llm_extra_body) (elevenlabs.io)
- Dynamic variables (system__conversation_id) (elevenlabs.io)
- Custom LLM integration and extra body (elevenlabs.io)
- React SDK startSession (user_id) (elevenlabs.io)
- Get conversation API (user_id field) (elevenlabs.io)
Sources:
Agent WebSockets | ElevenLabs Documentation
Integrate your own model | ElevenLabs Documentation
React SDK | ElevenLabs Documentation
Integrate your own model | ElevenLabs Documentation
Agent WebSockets | ElevenLabs Documentation
Dynamic variables | ElevenLabs Documentation
Integrate your own model | ElevenLabs Documentation
React SDK | ElevenLabs Documentation
Get conversation details | ElevenLabs Documentation
How do I send the system__conversation_id to the custom llm server in the body in every turn?