> ## Documentation Index
> Fetch the complete documentation index at: https://friendli.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Tool Assisted API

> Use the Friendli Tool Assisted API to extend chat completions with built-in and integrated tools. Models can call a calculator, Python interpreter, and web search automatically.

export const ToolIcon = () => {
  return <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor">
      <path d="M5.32943 3.27152C6.56252 2.83314 7.9923 3.10743 8.97927 4.0944C9.96652 5.08165 10.2407 6.51196 9.80178 7.74529L20.6465 18.5901L18.5252 20.7114L7.67936 9.86703C6.44627 10.3054 5.01649 10.0311 4.02952 9.04415C3.04227 8.0569 2.7681 6.62659 3.20701 5.39326L5.44373 7.62994C6.02952 8.21572 6.97927 8.21572 7.56505 7.62994C8.15084 7.04415 8.15084 6.0944 7.56505 5.50862L5.32943 3.27152ZM15.6968 5.15506L18.8788 3.38729L20.293 4.80151L18.5252 7.98349L16.7574 8.33704L14.6361 10.4584L13.2219 9.04415L15.3432 6.92283L15.6968 5.15506ZM8.62572 12.9332L10.747 15.0546L5.79729 20.0043C5.2115 20.5901 4.26175 20.5901 3.67597 20.0043C3.12464 19.453 3.09221 18.5792 3.57867 17.99L3.67597 17.883L8.62572 12.9332Z">
      </path>
    </svg>;
};

export const ChatIcon = () => {
  return <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
      <path d="M10 3H14C18.4183 3 22 6.58172 22 11C22 15.4183 18.4183 19 14 19V22.5C9 20.5 2 17.5 2 11C2 6.58172 5.58172 3 10 3Z">
      </path>
    </svg>;
};

**Tool Assisted API** extends [Friendli Model APIs](/guides/model-apis/introduction) chat completions with tool calling. The model decides when to call a tool, runs it, and uses the result to return a more accurate, up-to-date response—without you wiring up each tool yourself.

Two kinds of tools are available:

* **Built-in tools**: Available with no external setup—free and instantly usable, such as a calculator and a Python interpreter.
* **Integrated tools**: Backed by external services for production-grade performance. They require connecting your API key for the service, such as Linkup web search.

## Built-In Tools

Tool Assisted API automatically selects the best tool to perform an action based on user input when a specific tool is enabled. Built-in tools are available without any external integration, making them free to use and instantly accessible.
See the list below for available built-in tools.

### `math:calculator`

**Description:**

Performs basic arithmetic operations like addition, subtraction, multiplication, division, and more complex calculations like square roots or exponents.
It is useful for any tasks requiring mathematical computation.

**When Used:**

Automatically called when mathematical expressions or calculations are required.\
Whether you're solving equations, calculating percentages, or handling financial calculations, this tool performs the task for you.

### `code:python-interpreter`

**Description:**

Executes Python code directly within the platform for custom scripts, data processing, or automation.
You can run Python scripts, test snippets of code, or automate tasks through coding logic.

**When Used:**

Automatically called when tasks involve writing or running Python scripts, such as custom data manipulations or logic-based automation.

## Integrated Tools

Tool Assisted API can also make use of integrated tools, which operate in the same way as built-in tools but require a connection to external services.
Because they leverage specialized APIs or platforms, integrated tools are more likely to be production-ready compared to built-in tools, offering higher performance and broader functionality.

### `linkup:search` <img src="https://mintcdn.com/friendliai/Xn-EfFlXFvptInk9/static/svgs/linkup-icon-black-background.svg?fit=max&auto=format&n=Xn-EfFlXFvptInk9&q=85&s=847b879102a8678a93ca553bef51bfda" alt="Linkup" style={{ display: 'inline', width: '27px', height: '27px', margin: '-2px 0px 0px 0px', borderRadius: '100%' }} width="1700" height="1700" data-path="static/svgs/linkup-icon-black-background.svg" />

**Description:**

[Linkup](https://www.linkup.so) seamlessly integrates with models served by FriendliAI to provide real-time web search capabilities. This enables AI applications to retrieve up-to-date facts, events, and information beyond the model’s training data, complete with accurate citations.

Grounding responses in real-time data, Linkup improves precision, accuracy, and factuality while delivering production-ready state-of-the-art web information retrieval.

**When Used:**

Automatically called when you need to retrieve current information from the web, such as recent news, real-time data, or up-to-date facts.
This tool is particularly useful for tasks requiring accurate and reliable web search results.

<Info>
  This tool requires integration setup for SDK/API usage. You can obtain your Linkup API key from [app.linkup.so](https://app.linkup.so) and integrate it in the [Friendli Suite > Personal Settings > Integrations](https://friendli.ai/suite/~/setting/integrations).

  For more details, see the [Linkup integration guide](/integrate/sdks/linkup#for-sdk%2Fapi-usage).
</Info>

## Explore APIs

To get started with Tool Assisted APIs, follow this tutorial: [**Tool Calling with Model APIs**](/guides/tutorials/tool-calling-with-model-apis).

For more details, check out the API Reference documentation below:

<CardGroup cols={2}>
  <Card title="Chat completions" icon={<ChatIcon />} href="/openapi/model-apis/chat-completions">
    Discover how to generate text through interactive conversations.
  </Card>

  <Card title="Tool assisted chat completions (Beta)" icon={<ToolIcon />} href="/openapi/model-apis/tool-assisted-chat-completions">
    Learn how to enhance responses with tool-assisted chat completions using built-in tools.
  </Card>
</CardGroup>
