---
title: "Create a new API key"
method: POST
path: "/api/v1/keys"
---

# Create a new API key

`POST /api/v1/keys`

## Request

- Base URL: `https://api.virga.dev`
- URL: `https://api.virga.dev/api/v1/keys`
- Auth: API key in header `X-API-Key`

Create a new API key. Production keys require accepted terms, activated billing, and positive credit balance.

## Request body

- object
  - `name` string, required
  - `environment` 'stage' | 'production'
  - `permissions` string[]

## Response `201`

Key created

- object
  - `apiKey` string: Full API key (shown once)
  - `keyPrefix` string
  - `environment` string
  - `message` string

## Other responses

- `400`: Invalid request parameters
- `401`: Missing or invalid API key
- `403`: Account suspended, quarantined, or key revoked

---

[API](https://skmtc.dev/virga/apis/virga-api.md) · [All operations](https://skmtc.dev/virga/apis/virga-api/llms.txt) · [OpenAPI document](https://skmtc.dev/virga/apis/virga-api/revisions/5f5b639b1da3?raw)
