# Built-in Tools

### Available built-in tools

| Tool               | Trigger                                         | What it does                                           |
| ------------------ | ----------------------------------------------- | ------------------------------------------------------ |
| `image_generation` | "Generate an image of a sunset over the ocean"  | Generates images; URL embedded in response as markdown |
| `internet_search`  | "Latest news about AI", "What is today's date?" | Web search via Perplexity AI with citations            |
| `file_search`      | "Summarize the uploaded document"               | Searches vector stores from uploaded files             |
| `url_content`      | "Summarize <https://example.com/article>"       | Fetches and reads content from URLs                    |

### image generation

```json
{
  "model": "openai/gpt-4o",
  "messages": [
    { "role": "user", "content": "Generate an image of a futuristic city at sunset." }
  ]
}
```

The generated image URL is embedded as a markdown image inside `content`. Image cost is reported in `usage.tool_cost_usd`:

```json
{
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "I've generated the image of a futuristic city at sunset.\n\n![Generated Image](https://cdn.example.com/gen/abc123.png)"
      },
      "finish_reason": "stop"
    }
  ]
}
```

### File Search

The `file_search` tool lets the model search documents in pre-indexed file stores. Pass the store names in the request:

```json
{  
  "model": "openai/gpt-4o",
  "messages": [
    { "role": "user", "content": "Summarise the Q4 report" }
  ],
  "file_search_store_names": ["fileSearchStores/abc123"]
}  
```

The model will automatically call `file_search` with the provided store names when the query is relevant to the documents.

Store names are in the format `fileSearchStores/{storeId}`. You can pass multiple stores:<br>

```
"file_search_store_names": [
  "fileSearchStores/abc123",
  "fileSearchStores/def456"
]
```

### Internet Search

The `internet_search` tool queries the web via **Perplexity AI** and returns a synthesized, up-to-date answer with source citations. Use it for any question that requires current information beyond the model's training cutoff.

```json
{
  "model": "openai/gpt-4o-mini",
  "messages": [
    {
      "role": "user",
      "content": "What are the latest AI news today?"
    }
  ],
  "stream": false
}
```

### URL Content

The `url_content` tool fetches and processes the content of one or more URLs. It uses **Gemini 2.5 Flash** with Google's URL Context capability to retrieve, read, and reason over live web pages.

Use it when the user provides a specific link and asks questions about it — summarisation, extraction, comparison, Q\&A over a page, etc.

```json
{
  "model": "openai/gpt-4o-mini",
  "messages": [
    {
      "role": "user",
      "content": "Summarize this page and also team details: https://www.qolaba.ai/about-us"
    }
  ],
  "stream": false
}
```
