semvec/pypi-packages huggingface dataset:
agentkeys 0.1.0
Python SDK for AgentKeys — proxy API calls through a secure credential vault
License: MIT
Requires Python: >=3.9
Keywords: agentkeys, sdk, credentials, proxy, ai-agents, api-keys

# agentkeys-io

Python SDK for [AgentKeys](https://agentkeys.io) — proxy API calls through a secure credential vault. Your agent never sees the real API keys.

## Install

```bash
pip install agentkeys-io
```

## Usage

### With API key (recommended — access all credentials by name)

```python
from agentkeys import AgentKeys

ak = AgentKeys(
    token="ak_ws_your_key...",
    proxy_url="https://proxy.agentkeys.io",
)

# Proxy a request through the "resend" credential
response = ak.proxy(
    credential="resend",
    url="https://api.resend.com/emails",
    method="POST",
    body={
    },
)

print(response.json())
```

### With proxy token (single credential)

```python
ak = AgentKeys(token="pxr_resend_abc123...")

response = ak.proxy(
    credential="ignored",
    url="https://api.resend.com/emails",
    method="POST",
    body={""from": "hi@example.com", "to": "user@example.com", "subject": "Hello", "text": "Sent via AgentKeys"},
)
```

### Scoped client

```python
resend = ak.for_credential("resend")
stripe = ak.for_credential("stripe")

resend.post("https://api.resend.com/emails", body={
    "from": "hi@example.com",
    "to": "user@example.com",
    "subject": "Hello",
    "text": "Sent via AgentKeys",
})

balance = stripe.get("https://api.stripe.com/v1/balance")
```

### Context manager

```python
with AgentKeys(token="ak_ws_...") as ak:
    response = ak.proxy("resend", url="https://api.resend.com/emails", method="POST", body={...})
```

## Links

- [Dashboard](https://app.agentkeys.io)
- [Docs](https://agentkeys.io/docs)
- [Support](mailto:support@agentkeys.io)