https://retellai.com/?utm_source=discord&utm_medium=seo logo
We are connecting to third party organization via ...
# ❓・ai-evy-support
s
@AI Evy We are connecting to third party organization via Tools. How we intergrate its apis to the certain agent?
a
Thanks for tagging me @siren. I'll look through relevant sources and get back to you shortly.
### Answer To integrate third-party APIs with your Retell AI agent using Tools, you'll need to use the Custom LLM integration approach via the LLM WebSocket. [(1) ]() When using Custom LLM, your server receives tool call invocations from Retell AI and can execute API calls to third-party services. Here's how the integration works: Tool Call Invocation Flow: 1. Your agent triggers a tool call during conversation 2. You send a Tool Call Invocation Event to Retell AI with the tool details 3. Execute your third-party API call on your server 4. Send the result back to Retell AI using a Tool Call Result Event Tool Call Invocation Event format:
Copy code
json
{
  "response_type": "tool_call_invocation",
  "tool_call_id": "string",
  "name": "string",
  "arguments": "boolean"
}
Tool Call Result Event format:
Copy code
json
{
  "response_type": "tool_call_result",
  "tool_call_id": "string",
  "content": "string"
}
The
tool_call_id
is globally unique and links the invocation to its result. The
content
field contains the result from your third-party API, which can be a string or stringified JSON. This approach allows you to maintain full control over API authentication, error handling, and business logic while Retell AI manages the conversational flow.
​ To learn more, see the sources I considered: [[1] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.