> ## Documentation Index
> Fetch the complete documentation index at: https://phidatainc.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

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

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U agno openai requests
    ```
  </Step>

  <Step title="Export your OpenAI API key">
    <CodeGroup>
      ```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"
      ```
    </CodeGroup>
  </Step>

  <Step title="Run the example">
    Save the code above as `custom_api_tools.py`, then run:

    ```bash theme={null}
    python custom_api_tools.py
    ```
  </Step>
</Steps>

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