Skip to main content
POST
/
admin
/
projects
/
{project_id}
/
api-keys
PINECONE_PROJECT_ID="32c8235a-5220-4a80-a9f1-69c24109e6f2"
PINECONE_ACCESS_TOKEN="YOUR_ACCESS_TOKEN"

curl -X POST "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"] 
         }'
# Target the project for which you want to create an API key.
pc target -o "example-org" -p "example-project"
# Create the API key
pc api-key create -n "example-api-key" --roles ProjectEditor
{
  "key": {
    "id": "62b0dbfe-3489-4b79-b850-34d911527c88",
    "name": "example-api-key",
    "project_id": "32c8235a-5220-4a80-a9f1-69c24109e6f2",
    "roles": [
      "ProjectEditor"
    ],
    "created_at": "2025-10-20T23:40:27.069075Z"
  },
  "value": "..."
}
ATTRIBUTE     VALUE
Name          example-api-key
ID            62b0dbfe-3489-4b79-b850-34d911527c88
Value         ...
Project ID    32c8235a-5220-4a80-a9f1-69c24109e6f2
Roles         ProjectEditor
PINECONE_PROJECT_ID="32c8235a-5220-4a80-a9f1-69c24109e6f2"
PINECONE_ACCESS_TOKEN="YOUR_ACCESS_TOKEN"

curl -X POST "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"] 
         }'
# Target the project for which you want to create an API key.
pc target -o "example-org" -p "example-project"
# Create the API key
pc api-key create -n "example-api-key" --roles ProjectEditor
{
  "key": {
    "id": "62b0dbfe-3489-4b79-b850-34d911527c88",
    "name": "example-api-key",
    "project_id": "32c8235a-5220-4a80-a9f1-69c24109e6f2",
    "roles": [
      "ProjectEditor"
    ],
    "created_at": "2025-10-20T23:40:27.069075Z"
  },
  "value": "..."
}
ATTRIBUTE     VALUE
Name          example-api-key
ID            62b0dbfe-3489-4b79-b850-34d911527c88
Value         ...
Project ID    32c8235a-5220-4a80-a9f1-69c24109e6f2
Roles         ProjectEditor

Authorizations

Authorization
string
header
required

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

Path Parameters

project_id
string<uuid>
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
string[]

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

A role that can be assigned to an API key. Possible values: ProjectEditor, ProjectViewer, ControlPlaneEditor, ControlPlaneViewer, DataPlaneEditor, or DataPlaneViewer.

Response

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.