Skip to main content

Overview

Service accounts are non-human identities used for automation, CI/CD pipelines, and server-to-server integrations. They provide secure, programmatic access without requiring human authentication.

When to Use Service Accounts

Service accounts are ideal for:
  • CI/CD pipelines: Automated builds and deployments
  • Backend workers: Background jobs and scheduled tasks
  • Microservices: Service-to-service communication
  • Automated testing: Integration and end-to-end tests
  • Data processing: ETL pipelines and batch jobs

Creating Service Accounts

Service accounts are created at the organization level and can be assigned specific quotas and API keys.

Steps

  1. Navigate to your organization settings at console.compilelabs.com
  2. Go to the Service Accounts section
  3. Click “Create Service Account”
  4. Provide a descriptive name (e.g., “Production Worker”, “CI/CD Pipeline”)
  5. Optionally set credit limits and reset periods
  6. Create API keys for the service account

Example Workflow

  1. Create a service account named “Production Worker”
  2. Set a monthly credit limit of $500
  3. Generate an API key for the service account
  4. Copy the API key and store it securely (you won’t be able to see it again)
  5. Use the API key in your application’s environment variables
  6. Monitor usage and adjust limits as needed

Best Practices

Naming

Use descriptive names that indicate the service account’s purpose:
  • ✅ “Production Worker”
  • ✅ “CI/CD Pipeline”
  • ✅ “Data Processing Bot”
  • ❌ “SA1”
  • ❌ “Test”

Quotas

Set appropriate credit limits for automated workloads:
  • Consider expected usage patterns
  • Factor in peak load scenarios
  • Review and adjust regularly

API Key Management

  • Multiple Keys: Create separate API keys for different environments (dev, staging, production)
  • Rotation: Regularly rotate API keys for security
  • Naming: Name keys descriptively (e.g., “Production API Key - Backend Service”)
  • Limits: Set per-key quotas for granular control

Security

  • Never commit API keys to version control
  • Use environment variables or secret management systems
  • Monitor usage for unexpected patterns
  • Disable unused keys immediately

Service Account Management

Service accounts can be managed throughout their lifecycle through the dashboard:

Update a Service Account

To modify a service account:
  1. Navigate to the Service Accounts section in your organization settings
  2. Click on the service account you want to modify
  3. Update the name, credit limit, or reset period
  4. Save your changes

Managing API Keys

To create API keys for a service account:
  1. Navigate to the service account’s detail page
  2. Click “Create API Key”
  3. Provide a descriptive name for the key
  4. Optionally set credit limits and reset periods
  5. Copy the API key immediately (it won’t be shown again)
  6. Store it securely in your environment variables or secret management system
To view API keys:
  • API keys are listed on the service account detail page
  • Each key shows its name, creation date, and current status
  • You can disable or delete keys from this page

Delete a Service Account

To remove a service account:
  1. Navigate to the Service Accounts section
  2. Select the service account you want to delete
  3. Click the delete button
  4. Confirm the deletion
Deleting a service account will also delete all associated API keys. Make sure you have backups of any keys you need.

Usage Tracking

Track service account usage through your dashboard:
  • Monitor credit usage by service account
  • View API key usage within each service account
  • Set up alerts for quota warnings
  • Review historical usage patterns

Service Account vs User

FeatureService AccountUser
AuthenticationAPI keys onlyUsername/password, 2FA
PurposeAutomationHuman interaction
Dashboard accessNoYes
Quota inheritanceService account → OrgMember → Org
Use caseCI/CD, workers, botsInteractive apps, dashboards

Next Steps