PINECONE_API_KEY="YOUR_API_KEY"
INDEX_HOST="INDEX_HOST"

curl -X POST "https://$INDEX_HOST/vectors/upsert" \
  -H "Api-Key: $PINECONE_API_KEY" \
  -H "content-type: application/json" \
  -d '{
        "vectors": [
          {
            "id": "vec1",
            "values": [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8],
            "sparseValues": {
              "indices": [2, 7],
              "values": [0.4, 0.5]
            },
            "metatdata": {
              "genre": "drama"
            }
          },
          {
            "id": "vec2",
            "values": [0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9],
            "sparseValues": {
              "indices": [1, 4],
              "values": [0.1, 0.2]
            },
            "metadata": {
              "genre": "action"
            }
          }
        ]
      }'
{
  "upsertedCount": 2
}
PINECONE_API_KEY="YOUR_API_KEY"
INDEX_HOST="INDEX_HOST"

curl -X POST "https://$INDEX_HOST/vectors/upsert" \
  -H "Api-Key: $PINECONE_API_KEY" \
  -H "content-type: application/json" \
  -d '{
        "vectors": [
          {
            "id": "vec1",
            "values": [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8],
            "sparseValues": {
              "indices": [2, 7],
              "values": [0.4, 0.5]
            },
            "metatdata": {
              "genre": "drama"
            }
          },
          {
            "id": "vec2",
            "values": [0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9],
            "sparseValues": {
              "indices": [1, 4],
              "values": [0.1, 0.2]
            },
            "metadata": {
              "genre": "action"
            }
          }
        ]
      }'
{
  "upsertedCount": 2
}

Was this page helpful?