> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom API

> Call arbitrary REST endpoints with CustomApiTools, hitting the dog.ceo API for a random dog image and the full breed list.

Integrate custom APIs with Agno agents using `CustomApiTools`.

## Prerequisites

`CustomApiTools` accepts a base URL, basic authentication credentials, an API key, headers, SSL verification settings, and a request timeout.

```python theme={null}
from agno.agent import Agent
from agno.tools.api import CustomApiTools

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------

# Example 1: Enable specific API functions
agent = Agent(
    tools=[CustomApiTools(base_url="https://dog.ceo/api", enable_make_request=True)],
    markdown=True,
)

# Example 2: Enable all API functions
agent_all = Agent(
    tools=[CustomApiTools(base_url="https://dog.ceo/api", all=True)],
    markdown=True,
)

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
    agent.print_response(
        'Make api calls to the following two different endpoints- /breeds/image/random and /breeds/list/all to get a random dog image and list of dog breeds respectively. Make sure that the method is "GET" for both the api calls.'
    )
```

## Run the Example

<Snippet file="create-venv-step.mdx" />

**1. Install dependencies**

```bash theme={null}
uv pip install -U agno openai requests
```

**2. Export your OpenAI API key**

```bash Mac/Linux theme={null}
export OPENAI_API_KEY="your_openai_api_key_here"
```

```bash Windows theme={null}
$Env:OPENAI_API_KEY="your_openai_api_key_here"
```

**3. Run the example**

Save the code above as `custom_api_tools.py`, then run:

```bash theme={null}
python custom_api_tools.py
```

Full source: [cookbook/91\_tools/custom\_api\_tools.py](https://github.com/agno-agi/agno/blob/main/cookbook/91_tools/custom_api_tools.py)


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