---
title: "Get API keys"
method: GET
path: "/v1/projects/{projectId}/api-keys"
tags: ["API Keys"]
---

# Get API keys

`GET /v1/projects/{projectId}/api-keys`

## Request

- Base URL: `https://api.spice.ai`
- URL: `https://api.spice.ai/v1/projects/{projectId}/api-keys`
- Auth: HTTP bearer

Returns the API keys for a specific project. API keys are used to authenticate requests to the Spice.ai runtime.

## Path parameters

- `projectId` integer, required

## Headers

- `X-Org-Name` string

## Response `200`

API keys for the project

- ApiKeys
  - `api_key` string, nullable: Primary API key
  - `api_key_2` string, nullable: Secondary API key (for key rotation)

## Other responses

- `400`: Invalid project ID
- `401`: Unauthorized
- `403`: Insufficient scope or viewer role cannot regenerate API keys
- `404`: Project not found
- `500`: Internal server error

---

[API](https://skmtc.dev/spice/apis/spice-cloud-control-plane-api.md) - [All operations](https://skmtc.dev/spice/apis/spice-cloud-control-plane-api/llms.txt) - [OpenAPI document](https://skmtc.dev/spice/apis/spice-cloud-control-plane-api/revisions/5f3b75dd847d?raw)
