API Keys & Usage

Learn how to create, manage, and monitor your June API keys.

Creating an API Key

  1. Sign in to June and navigate to the API Keys page.
  2. Click Create New Key.
  3. Copy your API key and store it securely. You won't be able to see it again.

Managing Keys

You can create multiple API keys for different use cases (e.g., development and production, different apps, etc.). Each key can be individually deleted or rotated, without affecting your other keys.

  • Use separate keys for different environments to isolate usage and simplify debugging.
  • Never commit keys to version control. Use environment variables or a secrets manager.
  • Rotate keys — if you want to replace an API key you can click the Rotate button; we'll generate a new one for you, and automatically revoke the old one after a grace period where you can update your applications.

Viewing Usage

Monitor your API usage from the Usage page. You can track usage over time, by model. This helps you understand your spending and optimize model selection. You can also see how many credits you have left, and top up.

Rate Limits

API keys are subject to rate limits to ensure fair usage. If you hit a rate limit, the API will return a 429 status code. Implement exponential backoff in your application to handle these gracefully.