How do you update an OpenAI key for embeddings in ...
# community-help
d
How do you update an OpenAI key for embeddings in a collection without dropping the field? Asking because I'm pretty sure that dropping the field and adding it back would require us to re-index the data stored in that field
a
Hey Doug, You’ll want to generate a new OpenAI API key and then run this PATCH request to update the embedding config:
Copy code
curl "http://localhost:8108/collections/<your collection>" \
       -X PATCH \
       -H "Content-Type: application/json" \
       -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
       -d '{
         "fields": [
          {
            "name": "embedding",
            "embed": {
              "from": ["product_name"],
              "model_config": {
                "model_name": "openai/text-embedding-3-small",
                "api_key": "<new api key>"
              }
            }
          }
        ]
       }'