API Reference
Billing
Billing and usage information
Billing and usage information
GET /api/v1/teams/{teamId}/usage
Returns current usage statistics for a team
Operation ID: getTeamUsage · Authentication: Authorization: Bearer <token>
| Name | Type | Required | Description |
|---|
teamId | string (uuid) | yes | Team UUID |
| Status | Description | Body |
|---|
200 | Usage statistics | UsageStats |
401 | Authentication required | Error |
403 | Insufficient permissions | Error |
| Field | Type | Description |
|---|
projects | integer | |
environments | integer | |
secrets | integer | |
members | integer | |
curl -X GET "https://api.keyenv.dev/api/v1/teams/{teamId}/usage" \
-H "Authorization: Bearer $KEYENV_TOKEN"
GET /api/v1/teams/{teamId}/limits
Returns plan limits for a team
Operation ID: getTeamLimits · Authentication: Authorization: Bearer <token>
| Name | Type | Required | Description |
|---|
teamId | string (uuid) | yes | Team UUID |
| Status | Description | Body |
|---|
200 | Plan limits | PlanLimits |
401 | Authentication required | Error |
403 | Insufficient permissions | Error |
| Field | Type | Description |
|---|
plan | enum (free, team, enterprise) | |
projects | integer | Maximum number of projects (-1 for unlimited) |
environments_per_project | integer | |
secrets_per_environment | integer | |
members | integer | |
curl -X GET "https://api.keyenv.dev/api/v1/teams/{teamId}/limits" \
-H "Authorization: Bearer $KEYENV_TOKEN"
GET /api/v1/teams/{teamId}/billing
Returns billing information including current plan and subscription status
Operation ID: getTeamBilling · Authentication: Authorization: Bearer <token>
| Name | Type | Required | Description |
|---|
teamId | string (uuid) | yes | Team UUID |
| Status | Description | Body |
|---|
200 | Billing information | BillingInfo |
401 | Authentication required | Error |
403 | Insufficient permissions | Error |
| Field | Type | Description |
|---|
plan | enum (free, team, enterprise) | |
status | enum (active, canceled, past_due, trialing) | |
current_period_end | string (date-time) | |
cancel_at_period_end | boolean | |
curl -X GET "https://api.keyenv.dev/api/v1/teams/{teamId}/billing" \
-H "Authorization: Bearer $KEYENV_TOKEN"
POST /api/v1/teams/{teamId}/checkout
Creates a Stripe checkout session for upgrading the team's plan
Operation ID: createCheckoutSession · Authentication: Authorization: Bearer <token>
| Name | Type | Required | Description |
|---|
teamId | string (uuid) | yes | Team UUID |
application/json (required)
| Field | Type | Required | Description |
|---|
plan | enum (team, enterprise) | yes | |
success_url | string (uri) | no | |
cancel_url | string (uri) | no | |
| Status | Description | Body |
|---|
200 | Checkout session created | object |
400 | Invalid request | Error |
401 | Authentication required | Error |
403 | Insufficient permissions | Error |
| Field | Type | Description |
|---|
url | string (uri) | URL to redirect the user to for checkout |
curl -X POST "https://api.keyenv.dev/api/v1/teams/{teamId}/checkout" \
-H "Authorization: Bearer $KEYENV_TOKEN" \
-H "Content-Type: application/json" \
-d '{"plan":"team","success_url":"string","cancel_url":"string"}'
POST /api/v1/teams/{teamId}/portal
Creates a Stripe billing portal session for managing subscription
Operation ID: createPortalSession · Authentication: Authorization: Bearer <token>
| Name | Type | Required | Description |
|---|
teamId | string (uuid) | yes | Team UUID |
| Status | Description | Body |
|---|
200 | Portal session created | object |
401 | Authentication required | Error |
403 | Insufficient permissions | Error |
| Field | Type | Description |
|---|
url | string (uri) | URL to redirect the user to for the billing portal |
curl -X POST "https://api.keyenv.dev/api/v1/teams/{teamId}/portal" \
-H "Authorization: Bearer $KEYENV_TOKEN"