Skip to main content

Overview

All RunAgent API requests require authentication using API keys. This guide covers how to obtain, use, and manage API keys securely.

Obtaining API Keys

Via CLI

Via Dashboard

  1. Log in to dashboard.run-agent.ai
  2. Navigate to API Keys section
  3. Click “Create New Key”
  4. Copy and save securely

Using API Keys

Header Authentication

Include your API key in the Authorization header:

SDK Authentication

Environment Variable

Set the API key as an environment variable:

API Key Types

Personal Keys

  • Tied to your user account
  • Full access to your resources
  • Should not be shared

Service Keys

  • For production applications
  • Limited scope and permissions
  • Can be revoked independently

Temporary Keys

  • Short-lived tokens
  • For testing or demos
  • Auto-expire after set time

Security Best Practices

Key Storage

Never commit API keys to version control or expose them in client-side code.
DO:
DON’T:

Key Rotation

Regularly rotate your API keys:

Scope Limitation

Create keys with minimal required permissions:

Request Signing

For additional security, enable request signing:

OAuth 2.0 (Coming Soon)

Future support for OAuth 2.0 flow:

Rate Limiting

API keys have associated rate limits: Rate limit headers:

IP Whitelisting

Restrict API key usage to specific IPs:

Monitoring Key Usage

Via CLI

Via API

Error Responses

Invalid Key

Expired Key

Rate Limited

Troubleshooting

Key Not Working

  1. Check key format (should start with ra_)
  2. Verify key hasn’t expired
  3. Ensure proper Authorization header format
  4. Check IP whitelist settings
  5. Verify rate limits haven’t been exceeded

Permission Denied

  1. Check key scope and permissions
  2. Verify resource ownership
  3. Ensure key is active
  4. Check organization settings

See Also