Back to Documentation
Secure your API calls with API keys and OAuth
API Key Authentication
The simplest way to authenticate. Include your API key in the request header:
curl https://api.1cplatform.com/v1/agents \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Security Best Practices
- • Never commit API keys to version control
- • Use environment variables for production keys
- • Rotate keys regularly (every 90 days)
- • Use different keys for dev/staging/production
OAuth 2.0
For user-facing applications, use OAuth for secure delegated access:
// Step 1: Redirect user to authorization URL
const authUrl = `https://auth.1cplatform.com/oauth/authorize?
client_id=${clientId}&
redirect_uri=${redirectUri}&
response_type=code&
scope=agents:read agents:write`;
// Step 2: Exchange code for access token
const response = await fetch('https://auth.1cplatform.com/oauth/token', {
method: 'POST',
body: JSON.stringify({
grant_type: 'authorization_code',
code: authorizationCode,
client_id: clientId,
client_secret: clientSecret,
redirect_uri: redirectUri
})
});
const { access_token } = await response.json();Rate Limits
Free Tier
1,000 requests/hour
Perfect for development and testing
Pro Tier
100,000 requests/hour
For production applications
