Authentication
Authenticate with Metaphori to start compressing documents and managing your API keys.
Register and Login
Interactive Registration
The easiest way to get started is with interactive registration:
metaphori registerThis will guide you through the process of creating an account or logging in with your existing credentials.
Non-Interactive Registration
For CI/CD environments or automated setups:
metaphori register --email user@example.com --api-key mph-sk-xxxxxNote: You'll need to create an API key first. Visit metaphori.ai/dashboard to generate one.
API Key Management
Update Existing API Key
If you need to update your API key (e.g., after rotation):
metaphori register --update-keyCreating API Keys
You can create API keys through the web dashboard or CLI:
Via Web Dashboard:
- Visit metaphori.ai/dashboard
- Navigate to API Keys section
- Click "Create New Key"
- Copy the generated key (starts with
mph-sk-)
Via CLI (after initial auth):
metaphori auth api-key createEnvironment Variables
You can set authentication credentials using environment variables:
API Key
export METAPHORI_API_KEY=mph-sk-xxxxxThis takes precedence over stored credentials.
Custom API URL
export METAPHORI_API_URL=https://custom.api.urlFor enterprise or self-hosted deployments.
All Available Environment Variables
export METAPHORI_API_KEY=mph-sk-xxxxx
export METAPHORI_DEFAULT_MODEL=claude-3-5-sonnet
export METAPHORI_API_URL=https://custom.api.url
export METAPHORI_VERBOSE=trueVerifying Authentication
Check if you're properly authenticated:
metaphori config show api_keyOr check your usage to verify the connection:
metaphori usageSecurity Best Practices
๐ Keep Your API Key Secret
Never commit your API key to version control. Use environment variables or secure secret management.
๐ Rotate Keys Regularly
Rotate your API keys periodically. You can create new keys and delete old ones from the dashboard.
๐ฏ Use Scoped Keys
For CI/CD, create keys with limited permissions specific to the operations needed.
Troubleshooting
Invalid API Key Error
Ensure your API key starts with mph-sk- and hasn't been revoked.
Authentication Failed
Try re-registering with metaphori register --update-key
Environment Variable Not Working
Ensure you've exported the variable (not just set it) and that there are no trailing spaces.
Ready to compress your first document?
Now that you're authenticated, let's create your first compression.
Continue to Compression Management โ