// Requires Node.js SDK v8.2.0 or later
import { AdminClient } from '@pinecone-database/pinecone';
// Reads PINECONE_CLIENT_ID and PINECONE_CLIENT_SECRET from the environment
const admin = new AdminClient();
await admin.apiKeys.delete('YOUR_API_KEY_ID');
// Requires Go SDK v6.0.0 or later
package main
import (
"context"
"log"
"os"
"github.com/pinecone-io/go-pinecone/v6/pinecone"
)
func main() {
ctx := context.Background()
adminClient, err := pinecone.NewAdminClientWithContext(ctx, pinecone.NewAdminClientParams{
ClientId: os.Getenv("PINECONE_CLIENT_ID"),
ClientSecret: os.Getenv("PINECONE_CLIENT_SECRET"),
})
if err != nil {
log.Fatalf("Failed to create AdminClient: %v", err)
}
if err := adminClient.APIKey.Delete(ctx, "YOUR_API_KEY_ID"); err != nil {
log.Fatalf("Failed to delete API key: %v", err)
}
}
# Requires Terraform provider v4.0.0 or later
# This block defines the API key. To delete it, either remove the block and run
# `terraform apply`, or run:
# terraform destroy -target=pinecone_api_key.example
resource "pinecone_api_key" "example" {
name = "Example API Key"
project_id = "YOUR_PROJECT_ID"
}
PINECONE_ACCESS_TOKEN="YOUR_ACCESS_TOKEN"
PINECONE_API_KEY_ID="YOUR_KEY_ID"
curl -X DELETE "https://api.pinecone.io/admin/api-keys/$PINECONE_API_KEY_ID" \
-H "X-Pinecone-Api-Version: 2026-04" \
-H "Authorization: Bearer $PINECONE_ACCESS_TOKEN"
{
"error": {
"code": "UNAUTHENTICATED",
"message": "Invalid API key."
},
"status": 401
}{
"error": {
"code": "QUOTA_EXCEEDED",
"message": "The index exceeds the project quota of 5 pods by 2 pods. Upgrade your account or change the project settings to increase the quota."
},
"status": 429
}{
"error": {
"code": "QUOTA_EXCEEDED",
"message": "The index exceeds the project quota of 5 pods by 2 pods. Upgrade your account or change the project settings to increase the quota."
},
"status": 429
}{
"error": {
"code": "UNKNOWN",
"message": "Internal server error"
},
"status": 500
}{
"error": {
"code": "QUOTA_EXCEEDED",
"message": "The index exceeds the project quota of 5 pods by 2 pods. Upgrade your account or change the project settings to increase the quota."
},
"status": 429
}API keys
Delete an API key
Delete an API key from a project.
DELETE
/
admin
/
api-keys
/
{api_key_id}
// Requires Node.js SDK v8.2.0 or later
import { AdminClient } from '@pinecone-database/pinecone';
// Reads PINECONE_CLIENT_ID and PINECONE_CLIENT_SECRET from the environment
const admin = new AdminClient();
await admin.apiKeys.delete('YOUR_API_KEY_ID');
// Requires Go SDK v6.0.0 or later
package main
import (
"context"
"log"
"os"
"github.com/pinecone-io/go-pinecone/v6/pinecone"
)
func main() {
ctx := context.Background()
adminClient, err := pinecone.NewAdminClientWithContext(ctx, pinecone.NewAdminClientParams{
ClientId: os.Getenv("PINECONE_CLIENT_ID"),
ClientSecret: os.Getenv("PINECONE_CLIENT_SECRET"),
})
if err != nil {
log.Fatalf("Failed to create AdminClient: %v", err)
}
if err := adminClient.APIKey.Delete(ctx, "YOUR_API_KEY_ID"); err != nil {
log.Fatalf("Failed to delete API key: %v", err)
}
}
# Requires Terraform provider v4.0.0 or later
# This block defines the API key. To delete it, either remove the block and run
# `terraform apply`, or run:
# terraform destroy -target=pinecone_api_key.example
resource "pinecone_api_key" "example" {
name = "Example API Key"
project_id = "YOUR_PROJECT_ID"
}
PINECONE_ACCESS_TOKEN="YOUR_ACCESS_TOKEN"
PINECONE_API_KEY_ID="YOUR_KEY_ID"
curl -X DELETE "https://api.pinecone.io/admin/api-keys/$PINECONE_API_KEY_ID" \
-H "X-Pinecone-Api-Version: 2026-04" \
-H "Authorization: Bearer $PINECONE_ACCESS_TOKEN"
{
"error": {
"code": "UNAUTHENTICATED",
"message": "Invalid API key."
},
"status": 401
}{
"error": {
"code": "QUOTA_EXCEEDED",
"message": "The index exceeds the project quota of 5 pods by 2 pods. Upgrade your account or change the project settings to increase the quota."
},
"status": 429
}{
"error": {
"code": "QUOTA_EXCEEDED",
"message": "The index exceeds the project quota of 5 pods by 2 pods. Upgrade your account or change the project settings to increase the quota."
},
"status": 429
}{
"error": {
"code": "UNKNOWN",
"message": "Internal server error"
},
"status": 500
}{
"error": {
"code": "QUOTA_EXCEEDED",
"message": "The index exceeds the project quota of 5 pods by 2 pods. Upgrade your account or change the project settings to increase the quota."
},
"status": 429
}// Requires Node.js SDK v8.2.0 or later
import { AdminClient } from '@pinecone-database/pinecone';
// Reads PINECONE_CLIENT_ID and PINECONE_CLIENT_SECRET from the environment
const admin = new AdminClient();
await admin.apiKeys.delete('YOUR_API_KEY_ID');
// Requires Go SDK v6.0.0 or later
package main
import (
"context"
"log"
"os"
"github.com/pinecone-io/go-pinecone/v6/pinecone"
)
func main() {
ctx := context.Background()
adminClient, err := pinecone.NewAdminClientWithContext(ctx, pinecone.NewAdminClientParams{
ClientId: os.Getenv("PINECONE_CLIENT_ID"),
ClientSecret: os.Getenv("PINECONE_CLIENT_SECRET"),
})
if err != nil {
log.Fatalf("Failed to create AdminClient: %v", err)
}
if err := adminClient.APIKey.Delete(ctx, "YOUR_API_KEY_ID"); err != nil {
log.Fatalf("Failed to delete API key: %v", err)
}
}
# Requires Terraform provider v4.0.0 or later
# This block defines the API key. To delete it, either remove the block and run
# `terraform apply`, or run:
# terraform destroy -target=pinecone_api_key.example
resource "pinecone_api_key" "example" {
name = "Example API Key"
project_id = "YOUR_PROJECT_ID"
}
PINECONE_ACCESS_TOKEN="YOUR_ACCESS_TOKEN"
PINECONE_API_KEY_ID="YOUR_KEY_ID"
curl -X DELETE "https://api.pinecone.io/admin/api-keys/$PINECONE_API_KEY_ID" \
-H "X-Pinecone-Api-Version: 2026-04" \
-H "Authorization: Bearer $PINECONE_ACCESS_TOKEN"
Authorizations
An access token must be provided in the Authorization header using the Bearer scheme.
Headers
Required date-based version header
Path Parameters
API key ID
Response
API key deletion request accepted.
Was this page helpful?
⌘I