> SpecStream is the live web data engine for teams and agents. This is the Markdown copy of https://specstream.ai/docs/integrations/tyk-ai-studio. Every page, with what SpecStream does and costs: https://specstream.ai/llms.txt

# Tyk AI Studio

Add SpecStream's Search API and Extract API to Tyk AI Studio as one tool built from SpecStream's OpenAPI file. Chats, agents and Apps on your gateway can then search the live web and read pages, with the key kept in a Tyk secret.

[SpecStream for Tyk AI StudioAPI & cloud platforms](https://specstream.ai/integrations/tyk-ai-studio.md)

## What you need

-   A Tyk AI Studio you run yourself, Community or Enterprise Edition, and an admin account with the `tools:write` permission.
-   A SpecStream account. New accounts get $10 of credit on sign-up, no card. [Create one](https://specstream.ai/signup?utm_source=tyk-ai-studio).

1.  1

    ## 1. Create a SpecStream API key

    In SpecStream, open [Agents & API](https://specstream.ai/workspace/agents?tab=keys&utm_source=tyk-ai-studio), choose **API keys**, then **Create API key**, and set a total spending limit above zero: a key that searches or reads pages needs one. Copy the key from the next screen. SpecStream shows it once.

2.  2

    ## 2. Store the key as a secret, with Bearer in front

    In AI Studio, go to **Settings > Secrets** and create a secret. Set **Variable Name** to `SPECSTREAM_AUTH` and **Secret Value** to `Bearer`, a space, and your key.

    The word `Bearer` belongs in the value. SpecStream's OpenAPI file describes the key as an `apiKey` sent in the `Authorization` header, and AI Studio sets that header to the stored value as it is, adding nothing.

    Secret Value

    ```text
    Bearer YOUR_SPECSTREAM_KEY
    ```

3.  3

    ## 3. Download SpecStream's OpenAPI file

    Save [openapi.json](https://specstream.ai/openapi.json) to your computer. It is OpenAPI 3.1.0 in plain ASCII, with the full server address `https://api.specstream.ai` and an `operationId` on every operation, which is what AI Studio's importer needs.

    Upload the file rather than import it from its URL. **Import from URL** downloads the file in your browser, and the browser refuses a file from another site that sends no CORS header, as this one does not. AI Studio then shows: Your browser could not download the specification from this URL.

4.  4

    ## 4. Import it as a tool

    Go to **Context management > Tools** and click **Import OpenAPI**. Choose **Direct Import** and click **Next**.

    Under **Select Import Method**, choose **Upload File**, click **Choose File**, pick `openapi.json`, and click **Next**.

5.  5

    ## 5. Configure the tool

    AI Studio fills **Name** and **Description** from the file. The file's description covers all of SpecStream, so set **Name** to `SpecStream` and replace **Description** with one that tells the model what the two operations do:

    Description

    ```text
    Search the live web and read web pages. webSearch answers a question from the live web in seconds, each value with the page it came from: send the question in q. extractPages reads up to 20 pages and returns each page's main text, title and published date: send the addresses in urls.
    ```

6.  6

    ## 6. Add the secret and create the tool

    Keep **Auth Schema Name** as `apiKey`, the scheme AI Studio found in the file, and set **Auth Key** to `$SECRET/SPECSTREAM_AUTH`.

    Set **Privacy level** no higher than the level of the LLM that will call the tool: AI Studio refuses a tool whose level is above the LLM's. Chat is always on under **Access methods**. Turn on **REST API** or **MCP** only if Apps must call the tool on the gateway. Click **Create Tool**.

7.  7

    ## 7. Keep two operations

    The wizard adds every operation in the file to the tool, more than 200 of them. Open the tool, click **Edit tool**, and under **Operations** click **Clear**. Tick `webSearch` and `extractPages`, then click **Update tool**.

    Operations

    ```text
    webSearch      GET  /v1/web-search   search the live web
    extractPages   POST /v1/extract      read up to 20 pages
    ```

8.  8

    ## 8. Put the tool in a catalog

    In the Community Edition, a new tool joins the Default tool catalog, which the Default team already has.

    In the Enterprise Edition, go to **Catalogs > Tool catalogs** and click **Add catalog**. Enter a **Name**, select SpecStream in **Add tool**, and click **Create catalog**. Then assign the catalog to a team under **Teams**, and add it to the Chat Experience the team uses.

9.  9

    ## 9. Ask in a chat

    Ask something the model cannot know from its training:

    In an AI Studio chat

    ```text
    What changed in the EU AI Act timeline this month? Search the web and read the two most relevant pages.
    ```

## What the model gets back

`webSearch` returns the answer, the rows and the page each value came from, with up to 10 results by default and `num` up to 100. `passages=true` adds the text of the top pages closest to the question.

`extractPages` returns each page's main text as Markdown or plain text, its title and its published date, for up to 20 pages a call.

## What it costs

Each `webSearch` call is one Search API call at $5 per 1,000 searches of up to 10 results, or $1 per 1,000 when the call sends `speed=fast`. Each page `extractPages` reads costs $0.80 per 1,000 pages, and a page with no text is not charged. Both come out of your SpecStream balance, with no quote and no approval, and the key's spending limit caps the total. New accounts start with $10 of credit, no card. [Pricing](https://specstream.ai/pricing?utm_source=tyk-ai-studio).

## Call the tool from an App

With **REST API** on, developers call the tool's operations at `/tools/{slug}` on the AI Studio gateway with their App credential. With **MCP** on, an MCP client connects at `/tools/{slug}/mcp`, and `webSearch` and `extractPages` become MCP tools. The App must have the tool, and calls to an operation you did not tick get `403`.

## If a call fails

Calls refused as unauthorized: check that the secret value starts with `Bearer` and a space.

The gateway answers `403`: the access method is off on the tool, the App does not have the tool, or the operation is not ticked.

The tool is not in the chat: its privacy level is above the LLM's, or no catalog that reaches the user's team and Chat Experience holds it.

The full parameter lists are in the [Search API docs](https://specstream.ai/docs/search-api?utm_source=tyk-ai-studio) and the [Extract API docs](https://specstream.ai/docs/extract-api?utm_source=tyk-ai-studio).

## More

[SpecStream for Tyk AI Studio](https://specstream.ai/integrations/tyk-ai-studio.md) covers what it does in Tyk AI Studio on one page. Every other tool has its guide in [Connect your tools](https://specstream.ai/docs/integrations.md). You see the most a request can cost before it starts, and the matches are paid from your balance. [Billing](https://specstream.ai/docs/billing.md) has the details. For help, email [support@specstream.ai](mailto:support@specstream.ai).
