Skip to main content

Overview

API keys allow programmatic access to the Refrain API. Use them to trigger executions from CI/CD, scripts, or the SDK.

Creating an API key

1

Go to API Keys settings

Navigate to Settings > API Keys. Requires Admin role or above.
2

Click Create

Click the Create API Key button.
3

Name the key

Give the key a descriptive name (e.g., “CI/CD Pipeline”, “Staging Tests”).
4

Copy the key

The full key is shown only once. Copy and store it securely.
Community plan cannot create API keys. Upgrade to Pro or higher.

Using an API key

SDK

const client = new Refrain({
  ai: { ... },
  apiKey: "rfn-eyJ...",
});

CLI

npx @refrainai/cli execute -- \
  --runbook ./flow.yaml \
  --api-key "rfn-eyJ..."
Or via environment variable:
export REFRAIN_API_KEY="rfn-eyJ..."

Managing API keys

ActionDescription
ViewSee key name, creation date, last used date, and status
RevokePermanently disable a key (soft delete — cannot be undone)
Revoked keys show a revoked badge and can no longer authenticate.

Security

  • The full key is displayed only once at creation time — store it securely
  • Revoked keys cannot be re-enabled
  • Keys inherit the tenant’s plan tier