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

> ## Agent Instructions
> Every page is listed in https://docs.keenable.ai/llms.txt. To pick a product for a job, read https://docs.keenable.ai/choose.md
> Setup steps for agents, covering the SDKs, the MCP server and the CLI: https://docs.keenable.ai/skill.md
> Keenable search and fetch work without an API key. To add them to code, use the official SDK for the project's language: https://docs.keenable.ai/sdks.md
> Without a key, call POST https://api.keenable.ai/v1/search/public or GET https://api.keenable.ai/v1/fetch/public with an X-Keenable-Title header that names your app.
> With a key, send it in the X-API-Key header and read it from the KEENABLE_API_KEY environment variable. Never ask a user to paste a key into chat. Every access method: https://docs.keenable.ai/auth.md
> To get an API key without the console, use device login: https://docs.keenable.ai/authentication.md#device-login
> MCP server: https://api.keenable.ai/mcp (no key, or X-API-Key; keyless Codex uses https://api.keenable.ai/mcp-public), or https://api.keenable.ai/mcp-oauth for OAuth sign-in. These docs are an MCP server at https://docs.keenable.ai/mcp and the OpenAPI spec is at https://docs.keenable.ai/api-reference/openapi.json
> Keenable searches and fetches public web pages. If a question needs no web information, skip the call.
> On 402 with an API key (code insufficient_credits), stop and ask a human to add credits; don't retry. On 429, wait the number of seconds in Retry-After, then retry. Before you ship, follow https://docs.keenable.ai/production.md
> Every error, with its cause and fix, is in https://docs.keenable.ai/errors.md and moving from another search API is covered in https://docs.keenable.ai/migrate.md
> Before you compare Keenable with another search API, read https://docs.keenable.ai/guides/evaluate-search-apis.md

# Keenable search in RL and eval environments

> Use Keenable as the search backend in SkillOpt OfficeQA rollouts and Halo GRPO search environments: one config value, opt-in, never a default.

*Search backend in training and evaluation environments*

Two research frameworks can send their environment's web searches to Keenable: [SkillOpt](https://github.com/microsoft/SkillOpt) from Microsoft, for OfficeQA rollouts, and [Halo](https://github.com/whitecircle/halo) from White Circle, for async-GRPO search environments. In both, Keenable is opt-in. You select it with one config value, and the default backend doesn't change.

| Framework | Setting | Key | Where it is |
| - | - | - | - |
| SkillOpt | `env.search_mode=keenable` | Optional | `main` branch, after release 0.2.0 |
| Halo | `search_backend: keenable` | Required | `main` branch, after release 1.2.0 |

Both run from a checkout of the repository's `main` branch.

## SkillOpt OfficeQA

SkillOpt trains an agent's skill document against benchmarks. In OfficeQA, `env.search_mode` decides how a rollout gathers evidence. The default, `offline`, searches only the local document corpus. Set it to `keenable` on the command line:

```bash theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
python scripts/train.py \
  --config configs/officeqa/default.yaml \
  --cfg-options env.search_mode=keenable \
  --out_root outputs/officeqa_keenable
```

Each round sends each query from the model's `<search_queries>` to Keenable, one `POST` per query. A request carries the query text, `max_results`, an `X-Keenable-Title: SkillOpt` header and, only if you set `KEENABLE_API_KEY`, your key in `X-API-Key`. SkillOpt doesn't send the task question or the OfficeQA corpus. A generated query is model output, though, so it can repeat text from them.

| Setting | Default | What it does |
| - | - | - |
| `env.search_mode` | `offline` | `keenable` selects Keenable. It needs the `openai_chat` or `qwen_chat` backend, and no extra package. |
| `env.search_max_num_results` | `4` | Keenable results per query. |
| `env.max_queries_per_turn` | `4` | Queries per round, so a round can carry up to 16 results with the defaults. |
| `env.search_timeout_seconds` | `20` | Deadline for all queries of one round. |
| `KEENABLE_API_KEY` | unset | Optional. Without it, requests go to the keyless `/v1/search/public`. |

Keenable doesn't need the local OfficeQA corpus. Rate-limit and other service errors fail the rollout with a search diagnostic: SkillOpt never falls back to another provider. SkillOpt's docs note that scores with Keenable aren't directly comparable to the paper's Google-backed search setting.

## Halo search environments

In Halo, the `qa_search` environment (and `exam_qa` with `open_book`) gives the policy a web search tool. Set the backend in the environment's config:

```yaml theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
environment_type: qa_search
max_turns: 10
environment_kwargs:
  search_backend: keenable
```

Export your key in the training environment:

```bash theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
export KEENABLE_API_KEY="your-keenable-api-key"
```

Halo calls `POST https://api.keenable.ai/v1/search` with your key in `X-API-Key`. Each result's `snippet` is collapsed to one line and cut to 500 characters, because Keenable's snippet is page text where other backends return a sentence or two.

| `search_backend` | What happens |
| - | - |
| unset (auto) | The first backend with a key, in this order: Serper, Brave, Tavily, Keenable, then keyless DuckDuckGo. |
| `keenable` | Uses Keenable. Needs `KEENABLE_API_KEY`. |
| `duckduckgo` | The keyless default when no key is set. |

> [!WARNING]
>
> Halo's Keenable backend calls only the keyed endpoint. Without `KEENABLE_API_KEY`, every search returns `401` with the error code `missing_api_key`. Create a key in the [console](https://app.keenable.ai/console). See [API keys](https://docs.keenable.ai/api-keys.md).

> [!NOTE]
>
> SkillOpt without a key runs on the shared public tier at [lower rate limits](https://docs.keenable.ai/rate-limits.md), which a long training run can reach. Set `KEENABLE_API_KEY` for sustained runs.

## Related pages

> [card] [AgentField](https://docs.keenable.ai/integrations/agentfield.md)
>
> Run AgentField's deep research example on Keenable web search with SEARCH\_PROVIDER=keenable. No account or API key needed.

> [card] [ToolUniverse](https://docs.keenable.ai/integrations/tooluniverse.md)
>
> Select Keenable as the backend of ToolUniverse's web\_search tool with backend="keenable", in ToolUniverse 1.5.9 and later. No API key required.

> [card] [npcpy](https://docs.keenable.ai/integrations/npcpy.md)
>
> Search the web from npcpy with the keenable provider for search\_web, or call search\_keenable directly. No API key needed, in npcpy 2.1.28 and later.

> [card] [Overview](https://docs.keenable.ai/sdks.md)
>
> Install the official Keenable SDK for Python, TypeScript, Go or Rust with one command, search with no key, then add fetch, tool calling and Monitors.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.