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 platformsWhat you need
- A Tyk AI Studio you run yourself, Community or Enterprise Edition, and an admin account with the
tools:writepermission. - A SpecStream account. New accounts get $10 of credit on sign-up, no card. Create one.
- 1
1. Create a SpecStream API key
In SpecStream, open Agents & API, 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. 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_AUTHand Secret Value toBearer, a space, and your key.The word
Bearerbelongs in the value. SpecStream's OpenAPI file describes the key as anapiKeysent in theAuthorizationheader, and AI Studio sets that header to the stored value as it is, adding nothing.Secret Value - 3
3. Download SpecStream's OpenAPI file
Save openapi.json to your computer. It is OpenAPI 3.1.0 in plain ASCII, with the full server address
https://api.specstream.aiand anoperationIdon 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. 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. Configure the tool
AI Studio fills Name and Description from the file. The file's description covers all of SpecStream, so set Name to
SpecStreamand replace Description with one that tells the model what the two operations do:Description - 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. 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
webSearchandextractPages, then click Update tool.Operations - 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. Ask in a chat
Ask something the model cannot know from its training:
In an AI Studio chat
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.
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 and the Extract API docs.
More
SpecStream for Tyk AI Studio covers what it does in Tyk AI Studio on one page. Every other tool has its guide in Connect your tools. You see the most a request can cost before it starts, and the matches are paid from your balance. Billing has the details. For help, email [email protected].