Skip to main content

Python SDK for AgentKeys — proxy API calls through a secure credential vault

Project description

agentkeys-io

Python SDK for AgentKeys — proxy API calls through a secure credential vault. Your agent never sees the real API keys.

Install

pip install agentkeys-io

Usage

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

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)

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

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

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

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentkeys_io-0.1.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentkeys_io-0.1.1-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file agentkeys_io-0.1.1.tar.gz.

File metadata

  • Download URL: agentkeys_io-0.1.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for agentkeys_io-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c95fd75780a44fff3bdefb8a0249c7b1795f4af642bfe082f14f3112dea2f14e
MD5 2316aa360af3eedd82cb596203b9bd46
BLAKE2b-256 e289a74f85a448507b7266eac525bf1446a3f24c8973349adacd3216d34f2cc3

See more details on using hashes here.

File details

Details for the file agentkeys_io-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: agentkeys_io-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for agentkeys_io-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 da59e80fa85334bc72b5acabf5954286b6e7bf8ce5ee699ee0e804fce123dfcb
MD5 b2b1ccbe8308163a40f82c445782293c
BLAKE2b-256 4ba0f4d1a50992b914a31ee6be04e352cba50f715724a741110d576c44778c44

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page