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"]
}'
{
"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": "..."
}
API keys
Create an API key
Create a new API key for a project. Developers can use the API key to authenticate requests to Pinecone’s Data Plane and Control Plane APIs.
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"]
}'
{
"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": "..."
}
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"]
}'
{
"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": "..."
}
Authorizations
An access token must be provided in the Authorization header using the Bearer scheme.
Path Parameters
Project ID
Body
application/json
The details of the new API key.
The name of the API key. The name must be 1-80 characters long.
Required string length:
1 - 80Example:
"devkey"
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.
Was this page helpful?
⌘I