Metadata-Version: 2.5
Name: vallkey
Version: 0.1.0
Summary: Send any Python SDK through Vallkey with no code changes: requests that carry a ghost key go to Vallkey, nothing else is touched.
Project-URL: Homepage, https://vallkey.com
Project-URL: Documentation, https://vallkey.com/docs/#python
Author: Vallkey
License-Expression: MIT
License-File: LICENSE
Keywords: anthropic,api-keys,openai,secrets,security,stripe
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Security
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# vallkey

Send any Python SDK through [Vallkey](https://vallkey.com) with no code changes.

Vallkey gives you ghost keys: stand-in API keys that only work within your rules, and that you can kill in one click. This package sends every request that carries a ghost key to Vallkey instead of the provider, with the same path, so you do not need to set a base URL in any SDK. Requests without a ghost key are not touched.

```sh
pip install vallkey
```

Then either set an environment variable, with no change to your code:

```sh
VALLKEY_AUTO=1 python app.py
```

or import it once, anywhere in your code:

```python
import vallkey.auto
```

Put your ghost key where the real key was (for example `OPENAI_API_KEY=gk_openai_...`) and use the SDK as usual:

```python
from openai import OpenAI

client = OpenAI()  # no base_url needed
```

It covers httpx and httpx2 (OpenAI, Anthropic and most new SDKs), requests (Stripe, Twilio and most others), aiohttp and urllib. Libraries imported later are covered too, so the order of imports does not matter.

| Variable | |
| --- | --- |
| `VALLKEY_AUTO=1` | Turns it on when Python starts, without an import |
| `VALLKEY_API` | The Vallkey server, if not `https://api.vallkey.com` |
| `VALLKEY_DEBUG=1` | Logs each request sent to Vallkey (never the key) |

To set up ghost keys from your `.env` files, use the command line tool: `npx vallkey init`.

Docs: https://vallkey.com/docs/#python
