What you get
searchreturns ranked pages with their text extracted.fetchreturns one page as markdown.to_context()renders results as numbered[n] Title (url)sources a model can cite.TOOLSholds OpenAI-format definitions forkeenable_searchandkeenable_fetch. A helper runs whichever tool the model calls.- In Python,
AsyncKeenablehas the same methods as the sync client. - Every call works with no account and no key. An API key raises your rate limit.
Install
Install the package for your language:pip install. Install the Python package into a virtual environment: run python3 -m venv .venv, then source .venv/bin/activate. If your Go project already has a go.mod, skip go mod init.
Run a keyless search
This program runs one search without a key and prints the top 3 results as a citable block:
You see one
[n] Title (url) header per result, followed by the page text:
Example output · results vary
KEENABLE_API_KEY. The code stays the same.
Configuration
Every SDK reads two environment variables:
You can also pass settings to the constructor:
The SDK sends the client source as the
X-Keenable-Title header. It defaults to Keenable SDK. If you build an integration on top of an SDK, set it to your product’s name so Keenable attributes your traffic to your product.
Methods
Search filters follow the Search parameters, in each language’s naming style:
published_after in Python, publishedAfter in TypeScript, PublishedAfter in Go. SDK 0.1.x has three gaps:
- In Python and TypeScript,
modeaccepts onlypro. - No SDK sends
disable_cards. fetchtakes only a URL. Forlive,promptandmax_chars, call the HTTP API as shown on Fetch.
Errors
Every SDK raises typed errors that share one base class. See Errors for what each status code means and how to fix it.
In 0.1.x, an HTTP 402 (out of credits) raises the generic API error. To catch it, check
status_code == 402 in Python, statusCode === 402 in TypeScript, or StatusCode == 402 on an APIError in Go.