API Key Authentication
API keys are the recommended method for server-to-server communication. They provide secure, long-lived access to the API.Creating an API Key
- Log in to your G-Tateth account
- Navigate to Settings → Developer Console
- Click “Create API Key”
- Choose your environment (Production or Staging)
- Select permissions for the key
- Copy your API key (it’s only shown once!)
Using Your API Key
Include your API key in theAuthorization header:
X-API-Key header:
API Key Types
- Production keys (
sk_live_...) - Use in production environments - Test keys (
sk_test_...) - Use for development and testing
API Key Permissions
When creating an API key, select only the permissions it needs (principle of least privilege):
See the API Keys reference for more details.
API reference and Swagger UI
The interactive Swagger UI (requires JWT session) is at:JWT Authentication
JWT tokens can be used for user-authenticated requests. Obtain a JWT token through the authentication endpoints.Security Best Practices
- Never commit API keys to version control - Use environment variables
- Rotate keys regularly - Set up automatic rotation if possible
- Use test keys for development - Keep production keys secure
- Limit permissions - Only grant the minimum permissions needed
- Use IP whitelisting - Restrict API key access to specific IPs
- Monitor usage - Regularly check API key usage logs
Error Responses
If authentication fails, you’ll receive a401 Unauthorized response:
API_KEY_INVALID- Invalid API keyAPI_KEY_EXPIRED- API key has expiredAPI_KEY_INACTIVE- API key is inactiveTENANT_SUSPENDED- Tenant account is suspended