Documentation Index
Fetch the complete documentation index at: https://mintlify.com/21st-dev/1code/llms.txt
Use this file to discover all available pages before exploring further.
API Keys
The 1Code API uses API keys for authentication. Include your API key in theAuthorization header of each request.
Getting Your API Key
- Sign in to your 1Code account
- Navigate to Settings > API Keys
- Click “Create API Key”
- Copy and securely store your API key
API Key Format
API keys follow the format:- Keys starting with
1code_live_are production keys - Keys starting with
1code_test_are test keys (sandbox mode)
Authentication Errors
Missing API Key
HTTP 401 UnauthorizedInvalid API Key
HTTP 401 UnauthorizedExpired API Key
HTTP 401 UnauthorizedBest Practices
Store keys securely
Store keys securely
Use environment variables or a secrets manager to store API keys. Never hardcode them in your source code.
Rotate keys regularly
Rotate keys regularly
Generate new API keys periodically and revoke old ones to minimize security risks.
Use test keys for development
Use test keys for development
Use test keys during development to avoid affecting production data. Test keys run in sandbox mode.
Monitor API usage
Monitor API usage
Track your API usage in the dashboard to detect unauthorized access or unusual patterns.
Managing API Keys
List API Keys
View all your API keys in the dashboard at Settings > API Keys.Revoke API Keys
Revoke an API key immediately if it’s compromised:- Go to Settings > API Keys
- Click the revoke button next to the key
- Confirm revocation
Next Steps
Create your first task
Start using the API to run agent tasks