Sep 16, 2026

Give Codex or Claude Real-Time Web Search Through a Grok Endpoint

A 181-star skill that routes your agent's lookups — version numbers, API docs, error messages — through your own OpenAI-compatible Grok endpoint and returns JSON with sources.

#tutorial#web-search#developer-tools

Your agent's answers are only as fresh as its training cutoff — ask for a current version number or the status of a library and it guesses. The 181-star grok-skill wires real-time lookup into Codex or Claude by calling your own OpenAI-compatible Grok endpoint and returning the answer with its sources.

Why This Skill Matters

The repo bills itself as "a Codex/Claude skill that enables aggressive web research via your OpenAI-compatible Grok endpoint (2api)". The use cases it names are real-time information queries, version checking, and documentation lookup — exactly the questions where a stale model quietly hallucinates.

Two design choices carry the weight. Output is structured JSON with a content field plus a sources list, so your agent can cite instead of paraphrasing from memory. And configuration is layered — interactive script, config file, or environment variables — with a gitignored config.local.json override so the API key never lands in the repository.

Installation

The README documents a Windows PowerShell installer. Clone and run it:

git clone https://github.com/Frankieli123/grok-skill.git
cd grok-skill
powershell -ExecutionPolicy Bypass -File .\install.ps1

The manual alternative is downloading the ZIP from GitHub and running install.ps1 in PowerShell. Either way the skill lands at C:\Users\<YourUsername>\.codex\skills\grok-search\. The README documents only this PowerShell path — the project structure is a SKILL.md, a config template, the two PowerShell scripts, and scripts/grok_search.py, so the pieces are plain files, but no installer for other operating systems is documented.

Configuration

Three documented options, with the interactive one marked recommended in the README. Interactive first:

powershell -ExecutionPolicy Bypass -File "$env:USERPROFILE\.codex\skills\grok-search\configure.ps1"

Or edit config.json directly:

{
  "base_url": "https://your-grok-endpoint.example",
  "api_key": "YOUR_API_KEY",
  "model": "grok-2-latest",
  "timeout_seconds": 60,
  "extra_body": {},
  "extra_headers": {}
}

The fields are what they look like: base_url is your endpoint, model names the model (example grok-2-latest), timeout_seconds bounds the request, and extra_body and extra_headers pass through additional parameters. Or set GROK_BASE_URL, GROK_API_KEY, and GROK_MODEL as environment variables. For security, put the real key in config.local.json in the same directory — it is gitignored.

Real Workflow: Query from the Command Line

The search script is directly callable:

python scripts/grok_search.py --query "What is the latest version of Node.js?"

The answer comes back as JSON:

{
  "content": "The synthesized answer...",
  "sources": [
    {"url": "https://example.com", "title": "Source Title"}
  ]
}

Real Workflow: Make Your Agent Search First

The README shows the prompt rule to paste into your global agent configuration — C:\Users\<YourUsername>\.codex\AGENTS.md or ~/.claude/CLAUDE.md — so the skill fires before the agent answers. The documented trigger list covers seven situations: version numbers, release dates, or changelogs; API documentation or SDK usage; error messages or troubleshooting; the current status of any project, service, or technology; anything time-sensitive or possibly outdated; package installation commands or dependencies; and official documentation links. The rule ends by telling the agent to cite the sources in its response.

Tips

  • Keep the API key out of Git entirely — config.local.json exists precisely for that, and the README marks the key "DO NOT commit to Git".
  • The endpoint is yours to run: base_url points at your OpenAI-compatible Grok endpoint, so availability and rate limits are properties of the endpoint you configure.
  • The README ships in both English and Chinese in one file — useful reference if your team is mixed-language.

When Not to Use This

The skill presumes you operate an OpenAI-compatible Grok endpoint (the README's context is a 2api setup) — without one, there is nothing to point base_url at. The documented installer is Windows PowerShell, so other operating systems get no scripted setup. And if your runtime already has a search path you trust for a query, routing it through an external endpoint adds a dependency between the question and the answer.


See the leaderboard for more skills.