[metadata]
apple-mobile-web-app-title: Pinecone Docs
application-name: Pinecone Docs
description: Pinecone REST API: All requests to Pinecone APIs must contain a valid API key for the target project.
generator: Mintlify
google-site-verification: woTBImNAcYO-gseVfFKIzQrDRUmLWzFjBWrYbYkOTlI
msapplication-TileColor: #002BFF
msapplication-config: /mintlify-assets/_mintlify/favicons/pinecone/JqxxUxUkDTnX7oN2/_generated/favicon/browserconfig.xml
og:description: Pinecone REST API: All requests to Pinecone APIs must contain a valid API key for the target project.
og:image: https://www.pinecone.io/images/docs_og_image_v2.png
og:image:height: 630
og:image:width: 1200
og:site_name: Pinecone Docs
og:title: Authentication - Pinecone Docs
og:type: website
og:url: https://docs.pinecone.io/reference/api/authentication
twitter:card: summary_large_image
twitter:description: Search through billions of items for similar matches to any object, in milliseconds. It's the next generation of search, an API call away.
twitter:image: https://www.pinecone.io/images/docs_og_image_v2.png
twitter:image:height: 630
twitter:image:width: 1200
twitter:title: The vector database to build knowledgeable AI | Pinecone
viewport: width=device-width, initial-scale=1, viewport-fit=cover

[canonical-links]
https://docs.pinecone.io/reference/api/authentication

[document-links]
/llms.txt: /llms.txt
API key: /guides/production/security-overview#api-keys
Authentication: /reference/api/authentication
Authentication: /reference/cli/authentication
Command reference: /reference/cli/command-reference
Create a new API key: https://app.pinecone.io/organizations/-/projects/-/keys
Errors: /reference/api/errors
Examples: /examples/notebooks
Guides: /guides/get-started/overview
Integrations: /integrations/overview
Introduction: /reference/api/introduction
Log In: https://app.pinecone.io/?sessionType=login
Models: /models/overview
Pinecone APIs: /reference/api/introduction
Pinecone Docs home page: https://www.pinecone.io
Pinecone SDK: /reference/pinecone-sdks
Pinecone SDKs overview: /reference/pinecone-sdks
Quickstart: /reference/cli/quickstart
Reference: /reference/api/introduction
Releases: /release-notes/2026
See details: /guides/manage-cost/understanding-cost#imports
Sign up free: https://app.pinecone.io/?sessionType=signup
Spark-Pinecone connector: /reference/tools/pinecone-spark-connector
Status: https://status.pinecone.io
Support: https://app.pinecone.io/organizations/-/settings/support
Target context: /reference/cli/target-context
Troubleshooting: /troubleshooting/contact-support
Versioning: /reference/api/versioning
github: https://github.com/pinecone-io
linkedin: https://www.linkedin.com/company/pinecone-io
x: https://x.com/pinecone?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor
youtube: https://www.youtube.com/@pinecone-io

[structured-data]
{"@context":"https://schema.org","@graph":[{"@id":"https://docs.pinecone.io/#organization","@type":"Organization","logo":{"@type":"ImageObject","url":"https://mintcdn.com/pinecone/HsZKO51bNmpAasdT/logo/Pinecone-Full-Logo-Black.svg?fit=max&auto=format&n=HsZKO51bNmpAasdT&q=85&s=211d0e7bbefc29ce3b8feee1a05d76ee"},"name":"Pinecone Docs","url":"https://docs.pinecone.io"},{"@id":"https://docs.pinecone.io#website","@type":"WebSite","name":"Pinecone Docs","publisher":{"@id":"https://docs.pinecone.io/#organization"},"url":"https://docs.pinecone.io"},{"@id":"https://docs.pinecone.io/reference/api/authentication#webpage","@type":"WebPage","breadcrumb":{"@id":"https://docs.pinecone.io/reference/api/authentication#breadcrumb"},"dateModified":"2026-04-23T19:51:01.519Z","description":"Pinecone REST API: All requests to Pinecone APIs must contain a valid API key for the target project.","isPartOf":{"@id":"https://docs.pinecone.io#website"},"name":"Authentication","url":"https://docs.pinecone.io/reference/api/authentication"},{"@id":"https://docs.pinecone.io/reference/api/authentication#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","item":"https://docs.pinecone.io/reference/api/introduction","name":"APIs","position":1},{"@type":"ListItem","item":"https://docs.pinecone.io/reference/api/authentication","name":"Authentication","position":2}]},{"@id":"https://docs.pinecone.io/reference/api/authentication#article","@type":["Article","TechArticle"],"dateModified":"2026-04-23T19:51:01.519Z","description":"Pinecone REST API: All requests to Pinecone APIs must contain a valid API key for the target project.","headline":"Authentication","image":"https://www.pinecone.io/images/docs_og_image_v2.png","isPartOf":{"@id":"https://docs.pinecone.io#website"},"mainEntityOfPage":{"@id":"https://docs.pinecone.io/reference/api/authentication#webpage"},"name":"Authentication","publisher":{"@id":"https://docs.pinecone.io/#organization"},"url":"https://docs.pinecone.io/reference/api/authentication"}]}

[content]
Authentication - Pinecone Docs
Documentation Index
Fetch the complete documentation index at:
/llms.txt
Use this file to discover all available pages before exploring further.
Skip to main content
🎉 New: Standard and Enterprise orgs get a one-time
$250 bulk import credit
(1 TB), valid through August 30, 2026.
See details
Pinecone Docs
home page
2026-04 (latest)
Search...
⌘
K
Ask Assistant
Status
Support
Log In
Sign up free
Sign up free
Search...
Navigation
APIs
Authentication
Guides
Reference
Examples
Models
Integrations
Troubleshooting
Releases
Pinecone Database
APIs
Introduction
Authentication
Versioning
Limits
Errors
Database
Indexes
Namespaces
Vectors
Search
Imports
Backups
Backup schedules
Inference
Embed
Rerank
Models
Admin
API keys
Projects
Service accounts
Users
Invites
Role bindings
SDKs
Pinecone SDKs overview
Python
Node.js
Java
Go
CLI
Quickstart
Command reference
Authentication
Target context
Tools
Spark-Pinecone connector
On this page
Get an API key
Initialize a client
Add headers to an HTTP request
Troubleshooting
APIs
Authentication
Copy page
Copy page
Pinecone REST API: All requests to Pinecone APIs must contain a valid API key for the target project.
Copy page
Copy page
All requests to
Pinecone APIs
must contain a valid
API key
for the target project.
​
Get an API key
Create a new API key
in the Pinecone console, or use the connect widget below to generate a key.
Copy your generated key:
PINECONE_API_KEY="
YOUR_API_KEY
"
# This API key has ReadWrite access to all indexes in your project.
​
Initialize a client
When using a
Pinecone SDK
, initialize a client object with your API key and then reuse the authenicated client in subsquent function calls. For example:
Python
JavaScript
Java
Go
curl
from
pinecone.grpc
import
PineconeGRPC
as
Pinecone
from
pinecone
import
ServerlessSpec
pc
=
Pinecone(
api_key
=
'YOUR_API_KEY'
)
# Creates an index using the API key stored in the client 'pc'.
pc.create_index(
name
=
"docs-example"
,
dimension
=
1536
,
metric
=
"cosine"
,
spec
=
ServerlessSpec(
cloud
=
'aws'
,
region
=
'us-east-1'
)
)
import
{
Pinecone
}
from
'@pinecone-database/pinecone'
;
const
pc
=
new
Pinecone
({
apiKey:
'YOUR_API_KEY'
});
// Creates an index using the API key stored in the client 'pc'.
await
pc
.
createIndex
({
name:
'docs-example'
,
dimension:
1536
,
metric:
'cosine'
,
spec:
{
serverless:
{
cloud:
'aws'
,
region:
'us-east-1'
}
}
})
import
io.pinecone.clients.Pinecone;
import
org.openapitools.db_control.client.model.IndexModel;
import
org.openapitools.db_control.client.model.DeletionProtection;
public
class
CreateServerlessIndexExample
{
public
static
void
main
(
String
[]
args
) {
Pinecone
pc
=
new
Pinecone.
Builder
(
"YOUR_API_KEY"
).
build
();
// Creates an index using the API key stored in the client 'pc'.
pc
.
createServerlessIndex
(
"docs-example"
,
"cosine"
,
1536
,
"aws"
,
"us-east-1"
);
}
}
package
main
import
(
"
context
"
"
fmt
"
"
log
"
"
github.com/pinecone-io/go-pinecone/v3/pinecone
"
)
func
main
() {
ctx
:=
context
.
Background
()
pc
,
err
:=
pinecone
.
NewClient
(
pinecone
.
NewClientParams
{
ApiKey
:
"YOUR_API_KEY"
,
})
if
err
!=
nil
{
log
.
Fatalf
(
"Failed to create Client:
%v
"
,
err
)
}
indexName
:=
"docs-example"
vectorType
:=
"dense"
dimension
:=
int32
(
1536
)
metric
:=
pinecone
.
Cosine
deletionProtection
:=
pinecone
.
DeletionProtectionDisabled
idx
,
err
:=
pc
.
CreateServerlessIndex
(
ctx
,
&
pinecone
.
CreateServerlessIndexRequest
{
Name
:
indexName
,
VectorType
:
&
vectorType
,
Dimension
:
&
dimension
,
Metric
:
&
metric
,
Cloud
:
pinecone
.
Aws
,
Region
:
"us-east-1"
,
DeletionProtection
:
&
deletionProtection
,
})
if
err
!=
nil
{
log
.
Fatalf
(
"Failed to create serverless index:
%v
"
,
err
)
}
else
{
fmt
.
Printf
(
"Successfully created serverless index:
%v
"
,
idx
.
Name
)
}
}
curl
-s
"https://api.pinecone.io/indexes"
\
-H
"Api-Key: YOUR_API_KEY"
\
-H
"Content-Type: application/json"
\
-H
"X-Pinecone-Api-Version: 2025-10"
\
-d
'{
"name": "docs-example",
"dimension": 1536,
"metric": "cosine",
"spec": {
"serverless": {
"cloud":"aws",
"region": "us-east-1"
}
}
}'
​
Add headers to an HTTP request
All HTTP requests to Pinecone APIs must contain an
Api-Key
header that specifies a valid
API key
and must be encoded as JSON with the
Content-Type: application/json
header. For example:
curl
curl
https://api.pinecone.io/indexes
\
-H
"Content-Type: application/json"
\
-H
"Api-Key:
$PINECONE_API_KEY
"
\
-H
"X-Pinecone-Api-Version: 2025-10"
\
-d
'{
"name": "docs-example",
"dimension": 1536,
"metric": "cosine",
"spec": {
"serverless": {
"cloud":"aws",
"region": "us-east-1"
}
}
}'
​
Troubleshooting
Initialization errors due to outdated SDKs
Older versions of Pinecone required you to initialize a client with an
init
method that takes both
api_key
and
environment
parameters, for example:
Python
JavaScript
# Legacy initialization
import
pinecone
pc
=
pinecone.init(
api_key
=
"PINECONE_API_KEY"
,
environment
=
"PINECONE_ENVIRONMENT"
)
// Legacy initialization
import
{
Pinecone
}
from
'@pinecone-database/pinecone'
;
const
pineconeClient
=
new
PineconeClient
();
await
pineconeClient
.
init
({
apiKey:
'PINECONE_API_KEY'
,
environment:
'PINECONE_ENVIRONMENT'
,
});
In more recent versions of Pinecone, this has changed. Initialization no longer requires an
init
step, and cloud environment is defined for each index rather than an entire project. Client initialization now only requires an
api_key
parameter, for example:
Python
JavaScript
# New initialization
from
pinecone
import
Pinecone
pc
=
Pinecone(
api_key
=
"YOUR_API_KEY"
)
// New initialization
import
{
Pinecone
}
from
'@pinecone-database/pinecone'
;
const
pc
=
new
Pinecone
({
apiKey:
'YOUR_API_KEY'
});
If you are receiving errors about initialization, upgrade your
Pinecone SDK
to the latest version, for example:
Python
JavaScript
# Upgrade Pinecone SDK
pip
install
pinecone
--upgrade
# Upgrade Pinecone SDK
npm
install
@pinecone-database/pinecone@latest
Also, note that some third-party tutorials and examples still reference the older initialization method. In such cases, follow the example above and the examples throughout the Pinecone documentation instead.
Was this page helpful?
Yes
No
Introduction
Versioning
⌘
I
x
linkedin
youtube
github
Assistant
Responses are generated using AI and may contain mistakes.
