API Keys
API keys are essential for authenticating your requests to the Morph Cloud API. You can manage your API keys within the Morph Cloud dashboard, generating new keys and invalidating existing ones as needed for security best practices.
Authentication with API Keys
API keys are used for authenticating your requests to the Morph Cloud API.
There are two primary methods to authenticate the SDK:
-
Environment Variable: The recommended method for most scenarios is to set the
MORPH_API_KEY
environment variable.export MORPH_API_KEY="your_api_key_here"
-
Direct Initialization: You can also pass your API key directly when creating a
MorphCloudClient
instance.
- Python
- TypeScript
from morphcloud.api import MorphCloudClient
client = MorphCloudClient(api_key="your_api_key_here")
import { MorphCloudClient } from 'morphcloud';
const client = new MorphCloudClient({ apiKey: "your_api_key_here" });
Managing API Keys
You can manage your API keys through the Morph Cloud dashboard. This includes generating new keys, invalidating existing keys, and setting key permissions.
For security reasons, API key management is not available through the SDK and must be done through the dashboard interface.