POST
/
admin
/
projects
/
{project_id}
/
api-keys
PINECONE_ACCESS_TOKEN="YOUR_ACCESS_TOKEN"
PINECONE_PROJECT_ID="YOUR_PROJECT_ID"

curl "https://api.pinecone.io/admin/projects/$PINECONE_PROJECT_ID/api_keys" \
	-H "X-Pinecone-Api-Version: 2025-04" \
	-H "Authorization: Bearer $PINECONE_ACCESS_TOKEN" \
	-d '{
		"name": "Example API Key",
		"roles": ["ProjectEditor"]
	}'
{
  "key": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "name": "Example API key",
    "project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "roles": [
      "ProjectEditor"
    ]
  },
  "value": "string"
}
PINECONE_ACCESS_TOKEN="YOUR_ACCESS_TOKEN"
PINECONE_PROJECT_ID="YOUR_PROJECT_ID"

curl "https://api.pinecone.io/admin/projects/$PINECONE_PROJECT_ID/api_keys" \
	-H "X-Pinecone-Api-Version: 2025-04" \
	-H "Authorization: Bearer $PINECONE_ACCESS_TOKEN" \
	-d '{
		"name": "Example API Key",
		"roles": ["ProjectEditor"]
	}'
{
  "key": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "name": "Example API key",
    "project_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "roles": [
      "ProjectEditor"
    ]
  },
  "value": "string"
}

Authorizations

Authorization
string
header
required

An access token must be provided in the Authorization header using the Bearer scheme.

Path Parameters

project_id
string
required

Project ID

Body

application/json
The details of the new API key.
name
string
required

The name of the API key. The name must be 1-80 characters long.

Required string length: 1 - 80
Example:

"devkey"

roles
enum<string>[]

The roles to create the API key with. Default is ["ProjectEditor"].

A role that can be assigned to an API key.

Available options:
ProjectEditor,
ProjectViewer,
ControlPlaneEditor,
ControlPlaneViewer,
DataPlaneEditor,
DataPlaneViewer

Response

201
application/json
API key created successfully.

The details of an API key, including the secret. Only returned on API key creation.

key
object
required

The details of an API key, without the secret.

value
string
required

The value to use as an API key. New keys will have the format "pckey_<public-label>_<unique-key>". The entire string should be used when authenticating.