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

# Huggingface

> How to use Linkup with Huggingface

## Overview

Linkup can be used with [Huggingface](https://huggingface.co/docs/smolagents/en/index) (smolagents) to create advanced AI agents and workflows based on internal and web data.

## Getting Started with Linkup in Huggingface

**1. Get your Linkup API Key**

> [card] [Get your API key](https://app.linkup.so)
>
> Create a Linkup account for free to get your API key.

**2. Install dependencies**

```shell theme={"system"}
pip install linkup-sdk smolagents openai
```

**3. Create your agent**

```python theme={"system"}
from smolagents import CodeAgent, load_tool
from smolagents.models import OpenAIServerModel

linkup_tool = load_tool("Linkup-Platform/linkup-search-tool", trust_remote_code=True)
```

**4. Initialize and run your agent**

```python theme={"system"}
# Agent initialization
agent = CodeAgent(
    tools=[linkup_tool],
    model=OpenAIServerModel(
      model="gpt-4o-mini",
      api_key="your_openai_api_key"
    ),
)
# Agent invocation
response = agent.run("What was Microsoft's revenue last quarter and was it well perceived by the market?")
print(response)
```

## Example Response

```
Microsoft's revenue last quarter (3Q2024) was approximately $65.59 billion. The market's perception is mixed; while many analysts are optimistic about growth fueled by AI and cloud services, 
there are concerns regarding a lack of guidance in their report, leading to a cautious reaction from some investors.
```

> [!NOTE]
>
> **Need help?** Email `support@linkup.so`, ping us on [Discord](https://discord.com/invite/9q9mCYJa86), or [talk to us](https://calendar.app.google/zNUZz7RxgMMk9pKW7).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.