POST
/
indexes
PINECONE_API_KEY = "YOUR_API_KEY"

curl -s -X POST "https://api.pinecone.io/indexes" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "Api-Key: $PINECONE_API_KEY" \
  -d '{
         "name": "serverless-index",
         "dimension": 1536,
         "metric": "cosine",
         "spec": {
            "serverless": {
               "cloud": "aws",
               "region": "us-west-2"
            }
         }
      }'
{
    "name": "serverless-index",
    "metric": "cosine",
    "dimension": 1536,
    "status": {
        "ready": true,
        "state": "Ready"
    },
    "host": "serverless-index-4zo0ijk.svc.dev-us-west2-aws.pinecone.io",
    "spec": {
        "serverless": {
            "region": "us-west-2",
            "cloud": "aws"
        }
    }
}
PINECONE_API_KEY = "YOUR_API_KEY"

curl -s -X POST "https://api.pinecone.io/indexes" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "Api-Key: $PINECONE_API_KEY" \
  -d '{
         "name": "serverless-index",
         "dimension": 1536,
         "metric": "cosine",
         "spec": {
            "serverless": {
               "cloud": "aws",
               "region": "us-west-2"
            }
         }
      }'
{
    "name": "serverless-index",
    "metric": "cosine",
    "dimension": 1536,
    "status": {
        "ready": true,
        "state": "Ready"
    },
    "host": "serverless-index-4zo0ijk.svc.dev-us-west2-aws.pinecone.io",
    "spec": {
        "serverless": {
            "region": "us-west-2",
            "cloud": "aws"
        }
    }
}

Authorizations

Api-Key
string
header
required

Body

application/json

The desired configuration for the index.

The configuration needed to create a Pinecone index.

Response

201
application/json

The index has been successfully created.

The IndexModel describes the configuration and status of a Pinecone index.