Skip to content
grepturePublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Grepture Examples

Interactive demos showing how to route AI provider traffic through Grepture.

Each example is a standalone Vite + React app (except python/, which is a set of CLI scripts). API keys are entered in the browser — nothing is stored or processed server-side. Please remove dangerouslyAllowBrowser: true from the options before using in production!

Examples

Folder Provider SDK
openai/ OpenAI openai + @grepture/sdk
anthropic/ Anthropic @anthropic-ai/sdk + @grepture/sdk
gemini/ Google Gemini @google/genai (custom fetch)
vercel-ai-sdk/ Vercel AI SDK ai + @ai-sdk/openai + @grepture/sdk
stored-keys/ Stored provider keys openai + @anthropic-ai/sdk + @grepture/sdk
labels/ Per-team / per-project attribution openai + @grepture/sdk
python/ OpenAI (CLI scripts) openai (Python) + grepture (Python SDK)

labels

Shows how to attribute usage and cost to a team, project, or environment by tagging requests with a label. Call grepture.setLabel("team-marketing") (or pass a per-request fetch({ label })) and the proxy records the label on every traffic log. Grepture then aggregates cost, tokens, and request counts per label under Analytics → Usage & Cost → "Cost by label", and you can scope the whole tab to a single label or set a per-label spend budget. Send a few requests under different labels to see the breakdown populate.

stored-keys

Shows how to use Grepture's stored provider keys — no OpenAI/Anthropic key in your client code at all. Configure keys in Settings → API → Provider Keys, then omit apiKey from grepture.clientOptions(). The proxy resolves the team's stored key for the detected provider and automatically fails over to any configured fallback chain on 5xx (including cross-provider fallback with on-the-fly request/response translation).

python

Unlike the browser demos, these are terminal scripts using the Python SDK (grepture on PyPI): proxy mode with the OpenAI SDK, zero-latency trace mode, labels/metadata for cost attribution, and an asyncio variant. Keys are read from environment variables. See python/README.md for setup.

Running

cd openai   # or anthropic, gemini
npm install
npm run dev

Open http://localhost:5173, enter your Grepture and provider API keys, and send a prompt.

What it demonstrates

Each example sends a prompt containing fake PII (name, email, phone, SSN, address) through the Grepture proxy. If you have redaction rules configured, you'll see the PII stripped from the request before it reaches the AI provider.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages