> ## 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.

# Linkup

> Find and access high-quality web content using the Linkup API, integrated with Friendli Model APIs for seamless interaction.

export const RoundedBorderBox = ({children, caption}) => <div className="rounded-border-box">
    {children}
    {caption && <p className="text-sm text-gray-700 dark:text-gray-400">{caption}</p>}
  </div>;

**Linkup** provides real-time web search capabilities. With Linkup integration in Friendli, you can easily enhance your AI applications with up-to-date facts, recent events, and current information that goes beyond what your model was trained on.

You can use Linkup's real-time web search through Friendli Model APIs with just a few simple steps.

## How to Use

### For Playground Testing

1. Create an account at [**Friendli Suite**](https://friendli.ai/suite).
2. Go to **Model APIs** from your Project and click the **'Try'** button to open the playground.
3. In the playground, open the **Tools** panel and select **Search the web (Linkup)** to test the integration.

<RoundedBorderBox>
  <img alt="linkup-integrated-playground" src="https://mintcdn.com/friendliai/rNpjvhK2ESaMu_wl/static/images/integrate/sdks/linkup-playground.png?fit=max&auto=format&n=rNpjvhK2ESaMu_wl&q=85&s=ffd7da108368c0517a5c3a1266febb1b" width="422" height="298" data-path="static/images/integrate/sdks/linkup-playground.png" />
</RoundedBorderBox>

### For SDK/API Usage

1. Go to [**https://app.linkup.so**](https://app.linkup.so), and get your **Linkup API Key** (free tier available).
2. Go to [Friendli Suite > Personal Settings > Integrations](https://friendli.ai/suite/~/setting/integrations) and add your Linkup API key.

<Note>
  In the following code snippet, `API_KEY` refers to your **Personal API Key**, which you can obtain from [Friendli Suite > Personal Settings > API Keys](https://friendli.ai/suite/~/setting/keys) ([guide](/guides/suite/personal-api-keys)).
</Note>

<CodeGroup>
  ```bash curl {13-15} theme={null}
  curl --request POST \
    --url https://api.friendli.ai/serverless/tools/v1/chat/completions \
    --header 'Authorization: Bearer <API_KEY>' \
    --header 'Content-Type: application/json' \
    --data '{
    "model": "zai-org/GLM-5.2",
    "messages": [
      {
        "content": "Find information on the popular movies currently showing in theaters and provide their ratings.",
        "role": "user"
      }
    ],
    "tools": [
      { "type": "linkup:search" }
    ]
  }'
  ```

  ```python Python {17-19} theme={null}
  import os
  from openai import OpenAI

  client = OpenAI(
      api_key=os.getenv("API_KEY"),
      base_url="https://api.friendli.ai/serverless/tools/v1",
  )

  completion = client.chat.completions.create(
      model="zai-org/GLM-5.2",
      messages=[
          {
              "role": "user",
              "content": "Find information on the popular movies currently showing in theaters and provide their ratings."
          }
      ],
      tools=[
        {"type": "linkup:search"}
      ],
      stream=False
  )

  print(completion.choices[0].message.content)
  ```
</CodeGroup>

## Notes & Caveats

* **Playground vs. SDK/API**: In the playground, you can test web search functionality using a Linkup-sponsored API key. However, for SDK usage and API calls, you must provide your own Linkup API key.
* Make sure your Linkup integration is enabled in your Friendli account before calling the API — otherwise the `linkup:search` tool will error.
* Linkup and Friendli both have rate limits — handle retries/backoff accordingly.
* Keep API keys and tokens secret (use environment variables or secret managers).
