Hello everyone, I am trying to create a collection...
# community-help
c
Hello everyone, I am trying to create a collection for vector search with the OpenAI model, following the documentation I am getting this error, any suggestions on how to solve it?
Copy code
curl '<http://localhost:8108/collections>' \
  -X POST \
  -H 'Content-Type: application/json' \
  -H "X-TYPESENSE-API-KEY: <my-key>" \
  -d '{
        "name": "products",
        "fields": [
          {
            "name": "product_name",
            "type": "string"
          },
          {
            "name": "embedding",
            "type": "float[]",
            "embed": {
              "from": [
                "product_name"
              ],
              "model_config": {
                "model_name": "openai/text-embedding-3-small",
                "api_key": "openai-api-key"
              }
            }
          }
        ]
      }'
I see this error message in my logs
Copy code
Validating and initializing remote model: openai/text-embedding-3-small
Exception while calling handler collections:create
Raw error: [json.exception.type_error.302] type must be string, but is null
i am using typesense self-hosted with docker compose
j
I just tried that same payload and it works for me...
I wonder if there's some issue with your API key that's returning an error that we're not handling correctly
Could you use that API key directly in a curl request to OpenAI's API directly?
c
Hi @Jason Bosco you are right, it was something with the api key, I changed the api_key and now it works fine. Thanks 🤘🏼
🙌 1