---
title: "Creates an API key"
method: POST
path: "/v1/api_keys"
---

# Creates an API key

`POST /v1/api_keys`

Creates an API key with the provided name and type. The API key is returned in the response.

## Request body

- CreateAPIKeyRequestV1 — Request to create an API key.
  - `name` string, nullable — Optional name for the API key
  - `type` 'PERSONAL' | 'WORKSPACE_MANAGE_ALL' | 'WORKSPACE_EXPORT_METRICS' | 'WORKSPACE_INVOKE' | 'WORKSPACE_MANAGE_API_KEYS', required — Enum representing the category of an API key.
  - `model_ids` string[], nullable — List of model IDs to scope the API key to, only present if type is 'WORKSPACE_EXPORT_METRICS' or 'WORKSPACE_INVOKE'

## Response `200`

- APIKeyV1 — Represents an API key.
  - `api_key` string, required — The API key string

---

[API](https://skmtc.net/baseten/apis/baseten-inference-api.md) · [All operations](https://skmtc.net/baseten/apis/baseten-inference-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/baseten/baseten-inference-api/versions/a55a2f64c3c5/schema)
