Your API key is used to authenticate requests to the Moru API. You can use it with the SDK or set it as an environment variable.
Getting Your API Key
- Go to Dashboard > API Keys
- Click Create API Key
- Copy your API key
Keep your API key secure. Do not expose it in client-side code or commit it to version control.
Using the API Key
Environment Variable (Recommended)
Set the MORU_API_KEY environment variable. The SDK will automatically use it.
export MORU_API_KEY=your_api_key_here
Then use the SDK without passing the key:
from moru import Sandbox
sandbox = Sandbox.create()
Inline (Direct)
You can also pass the API key directly to the SDK:
from moru import Sandbox
sandbox = Sandbox.create(api_key="your_api_key_here")
Next Steps