Get the FREE Ultimate OpenClaw Setup Guide →
I

Keys

Verified

@ivangdavila

npx machina-cli add skill @ivangdavila/keys --openclaw
Files (1)
SKILL.md
1.2 KB

Usage

Make authenticated API calls without seeing the key:

keys-broker call '{"action":"call","service":"openai","url":"https://api.openai.com/v1/chat/completions","method":"POST","body":{"model":"gpt-4","messages":[{"role":"user","content":"Hello"}]}}'

Response:

{"ok": true, "status": 200, "body": {...}}

Supported Services

Only preconfigured services work (security: prevents key exfiltration):

  • openai → api.openai.com
  • anthropic → api.anthropic.com
  • stripe → api.stripe.com
  • github → api.github.com

To add services, edit ALLOWED_URLS in keys-broker.sh.

Rules

  1. Never retrieve keys directly — always use keys-broker call
  2. Never ask user to paste keys in chat — guide them to keychain commands

Other Tasks

  • First time setup → see setup.md (install keys-broker.sh)
  • Add/remove/rotate keys → see manage.md

Limitations

Does NOT work in: Docker containers, WSL, headless Linux servers (no keychain access).

Source

git clone https://clawhub.ai/ivangdavila/keysView on GitHub

Overview

Keys provides secure API key management through a broker so the agent never sees the actual key. It supports preconfigured services (OpenAI, Anthropic, Stripe, GitHub) and uses a keys-broker call to run authenticated requests. This reduces key exfiltration risk in automated workflows by keeping secrets out of the agent context.

How This Skill Works

Requests are proxied through the keys-broker, which attaches the correct API key to outgoing calls without exposing it to the agent. You describe the target service, URL, method, and body in a JSON action, and the broker executes the request and returns the response. Access is restricted by ALLOWED_URLS in keys-broker.sh, and the setup notes that it does not work in Docker containers, WSL, or headless Linux servers lacking keychain access.

When to Use It

  • When your agent must call OpenAI without leaking the API key.
  • When you need to perform requests to preconfigured services (OpenAI, Anthropic, Stripe, GitHub) securely.
  • When you want to prevent key exfiltration in automated or bot workflows.
  • When you want to extend service support by editing ALLOWED_URLS in keys-broker.sh.
  • When you must avoid handling keys directly in chat or prompts.

Quick Start

  1. Step 1: Install keys-broker.sh (first-time setup) per setup.md.
  2. Step 2: Add/rotate keys using manage.md to keep credentials up to date.
  3. Step 3: Make a sample call with keys-broker, e.g., the JSON action shown in the usage example.

Best Practices

  • Always route API calls through keys-broker call; never retrieve keys directly.
  • Keep keys in your OS keychain and avoid pasting keys into chat; follow the rule to never expose keys in prompts.
  • Regularly rotate keys and manage them via manage.md.
  • Limit services to those defined in ALLOWED_URLS to prevent exfiltration.
  • Test calls and verify broker responses before integrating into production workflows.

Example Use Cases

  • OpenAI chat completions via keys-broker call to keep the API key hidden from the agent context.
  • Anthropic API request using the preconfigured service mapping.
  • Stripe create charge call performed securely through the broker.
  • GitHub API request (e.g., listing repos) without exposing credentials in prompts.
  • Extending service support by editing ALLOWED_URLS in keys-broker.sh.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers