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

# Setting Up WebAccess API Parameters

> Configure Serper and Tavily API keys for web search — via the WebAccess UI, Connections, environment variables, or in-chat tool actions.

## **Overview**

### **Purpose**

This guide walks you through configuring web search for Genesis agents. Genesis supports two search providers:

* **Serper** ([serper.dev](https://serper.dev)) — Google SERP results; best for navigational queries and specialized result types (images, maps, scholar, and more).
* **Tavily** ([tavily.com](https://tavily.com)) — LLM/agent-optimized search with optional inline page-text extraction; best for knowledge and evidence gathering from public pages.

You can configure keys in the WebAccess UI, as saved Connections (`google_search` and `tavily`), via `SERPER_API_KEY` / `TAVILY_API_KEY` environment variables, or in chat with `search_web(action='set_serper_key'|'set_tavily_key', api_key=...)`.

### Steps

**1. Obtain API Keys**

Acquire and securely store API keys from Serper and/or Tavily for web search.

**2. Secure WebAccess Configuration**

Input the key into the WebAccess interface, ensuring only authorized processes can invoke searches.

**3. Testing & Troubleshooting**

Validate the integration by performing test queries and monitoring potential errors or usage limits.

## **Step-by-Step Setup**

### **Step 1: Navigate to the API Key Setup Page**

1. **Open Web Access Setup**

   * Access the WebAccess configuration page within the Genesis Bots environment.

2. **Locate Serper Search API Key Section**

   * Look for a labeled field: "Google Serper Search API Key."

   * You'll find:

     * An input field to paste your API key.

     * A link labeled "here" pointing to Serper's website for obtaining the key.

### **Step 2: Obtain the Serper API Key**

1. **Follow the Provided Link**

   * Click "here" or visit [https://serper.dev/](https://serper.dev/) manually.

2. **Sign Up or Log In**

   * If you're new, create an account; otherwise, log in with your existing credentials.

3. **Go to API Key Section**

   * Look for "API Tokens" or "API Key Management" in your account settings or dashboard.

4. **Generate Your API Key**

   > [!WARNING]
   >
   > **Important**: This key is shown only once – store it securely to avoid losing access.

   * Click "Create API Key," label it (e.g., "Bot Integration"), and **copy** the generated key.

### **Step 3: Input the API Key in the WebAccess Setup**

1. **Return to the Setup Page**

   * Navigate back to the "Google Serper Search API Key" field in WebAccess.

2. **Paste Your Key**

   * Enter the key you copied from Serper.

   * Check for trailing spaces or hidden characters.

### **Step 4: Save and Apply the Configuration**

1. **Click Save or Submit**

   * Look for a confirmation message once you apply your key.

2. **Success Confirmation**

   * In Snowflake / SPCS deployments, complete any **Approve External Access** and **Assign to Genesis** actions first. Genesis refreshes the assignment immediately after the user-triggered step.

   * A green "Web Access External Access Integration is available" message indicates correct setup.

### **Step 5: Configure Tavily (optional)**

1. **Obtain a Tavily API Key**

   * Visit [https://tavily.com/](https://tavily.com/) and create an API key.

2. **Save the key**

   * **Connections UI**: Open **Config → Connections → + New Connection**, select **Tavily AI Search**, choose **API Key**, paste the key, test, and save. On Snowflake / SPCS deployments, approve external access for `api.tavily.com` when prompted.
   * **WebAccess UI**: If your deployment exposes a Tavily key field, paste the key there.
   * **Environment variable**: Set `TAVILY_API_KEY`.
   * **In chat**: `search_web(action='set_tavily_key', api_key='your_tavily_key')`.

> [!NOTE]
>
> Adding a Tavily key does not by itself change which provider `search_web` uses when `provider='auto'` (the default). The default remains **serper** unless an operator sets `tools.web_access.default_search_provider` to `tavily`.

### **Step 6: Test the WebAccess API Integration**

1. **Perform a Test Query**

   * For instance, ask an agent to search "Weather today" and confirm results return.

2. **Check for Errors**

   * If you see "Unauthorized" or "API Key Invalid," re-check your key or provider account settings.

> [!NOTE]
>
> **Additional Tips**
>
> * Treat your API key like a password—don't share it publicly.
>
> * If compromised, revoke it in Serper's dashboard.
>
> * Check free-tier limits or daily usage to avoid interruptions.

## **Integration Relevance**

* **Search-Based Workflows**: Once configured, the WebAccess integration can run Google queries within tasks or automation flows.

* **Report Generation**: Combine query results with analytics to enrich dataset insights.

* **Monitoring & Alerts**: Periodically search for relevant news or updates (e.g., competitor activity) and notify team members.

## **Configuration Details**

* **Credentials**: Store the API key in a secure location—environment variables or a credential manager—to maintain best practices.

* **Permissions**: Validate Serper usage limits and confirm your plan supports the number of queries required.

* **Network Check**: Ensure the bot or workflow environment can reach Serper endpoints (`google.serper.dev`, `scrape.serper.dev`) and, when using Tavily, `api.tavily.com`.

### How It Works

Agents call `search_web` to retrieve results. With `provider='auto'` (the default), Genesis uses the operator-configured default (`tools.web_access.default_search_provider`, **serper** unless changed), then falls back to whichever provider has a key. For Genesis AI no-key search eligibility on Genesis Desktop and owner-credit hosted Try Me instances, see [Web Access Tools](https://docs.genesiscomputing.com/docs/Genbot-Toolkit/Web-Access-Tools.md) for provider behavior. Force a provider with `provider='serper'` or `provider='tavily'`.

The tool returns structured data — titles, snippets, links, and (for Tavily with `include_raw_content`) extracted page text — for downstream automation or enrichment.

**Example**
After entering your Serper key and seeing a success message, you might instruct a bot to search "Snowflake scaling best practices." The bot uses `search_web` with the Serper provider to retrieve search snippets. For evidence from a specific government domain, you might use Tavily: `search_web(query='...', provider='tavily', search_depth='advanced', include_raw_content=True, include_domains=['example.gov'])`.
