X-Azure-Api-Key doesn't work in headers. Asking openai api key instead. while calling withNearText search

I am working with weaviate ts library and azure openai.

I am using azure openai but it force me to use openai apis. I have mentioned resourcename and deploymentid in module config and headers

My client config and header:

const client = weaviate.client({
    scheme: 'https',
    host: 'xxxx-vv0royyl.weaviate.network',
    headers: {
        
        "X-Openai-Api-Key": "bXXxxxxxxxxxxx5b7238079",
        "X-Azure-Api-Key": "bXXxxxxxxxxxxx5b7238079",
        "baseURL": "https://sample.openai.azure.com",
        "deploymentId": "embedding-dev",
        "resourceName": "Raptor1"
    }
});

My Class definition:

{
  "classes": [
    {
      "class": "Custcity",
      "invertedIndexConfig": {
        "bm25": {
          "b": 0.75,
          "k1": 1.2
        },
        "cleanupIntervalSeconds": 60,
        "stopwords": {
          "additions": null,
          "preset": "en",
          "removals": null
        }
      },
      "moduleConfig": {
        "text2vec-openai": {
          "X-Azure-Api-Key": "b4dXXXXXXXXXXXXXXXXXX238079",
          "baseURL": "https://sample.openai.azure.com",
          "deploymentId": "embedding-dev",
          "model": "ada",
          "resourceName": "Raptor1",
          "vectorizeClassName": true
        }
      },
      "multiTenancyConfig": {
        "enabled": false
      },
      "properties": [
        {
          "dataType": [
            "text"
          ],
          "indexFilterable": true,
          "indexSearchable": true,
          "moduleConfig": {
            "text2vec-openai": {
              "skip": false,
              "vectorizePropertyName": false
            }
          },
          "name": "question",
          "tokenization": "word"
        },
        {
          "dataType": [
            "text"
          ],
          "indexFilterable": true,
          "indexSearchable": true,
          "moduleConfig": {
            "text2vec-openai": {
              "X-Azure-Api-Key": "b4dXXXXXXXXXXXXXXXXXX238079",
              "baseURL": "https://sample.openai.azure.com",
              "deploymentId": "embedding-dev",
              "resourceName": "Raptor1",
              "skip": false,
              "vectorizePropertyName": false
            }
          },
          "name": "content",
          "tokenization": "word"
        },
        {
          "dataType": [
            "int"
          ],
          "indexFilterable": true,
          "indexSearchable": false,
          "moduleConfig": {
            "text2vec-openai": {
              "skip": true,
              "vectorizePropertyName": false
            }
          },
          "name": "contentLength"
        },
        {
          "dataType": [
            "text"
          ],
          "indexFilterable": true,
          "indexSearchable": true,
          "moduleConfig": {
            "text2vec-openai": {
              "skip": true,
              "vectorizePropertyName": false
            }
          },
          "name": "contentToken",
          "tokenization": "word"
        },
        {
          "dataType": [
            "text"
          ],
          "indexFilterable": true,
          "indexSearchable": true,
          "moduleConfig": {
            "text2vec-openai": {
              "skip": true,
              "vectorizePropertyName": false
            }
          },
          "name": "model",
          "tokenization": "word"
        },
        {
          "dataType": [
            "text"
          ],
          "indexFilterable": true,
          "indexSearchable": true,
          "moduleConfig": {
            "text2vec-openai": {
              "skip": true,
              "vectorizePropertyName": false
            }
          },
          "name": "userId",
          "tokenization": "word"
        },
        {
          "dataType": [
            "text"
          ],
          "indexFilterable": true,
          "indexSearchable": true,
          "moduleConfig": {
            "text2vec-openai": {
              "skip": true,
              "vectorizePropertyName": false
            }
          },
          "name": "trainingDataType",
          "tokenization": "word"
        }
      ],
      "replicationConfig": {
        "factor": 1
      },
      "shardingConfig": {
        "virtualPerPhysical": 128,
        "desiredCount": 1,
        "actualCount": 1,
        "desiredVirtualCount": 128,
        "actualVirtualCount": 128,
        "key": "_id",
        "strategy": "hash",
        "function": "murmur3"
      },
      "vectorIndexConfig": {
        "skip": false,
        "cleanupIntervalSeconds": 300,
        "maxConnections": 64,
        "efConstruction": 128,
        "ef": -1,
        "dynamicEfMin": 100,
        "dynamicEfMax": 500,
        "dynamicEfFactor": 8,
        "vectorCacheMaxObjects": 1000000000000,
        "flatSearchCutoff": 40000,
        "distance": "cosine",
        "pq": {
          "enabled": false,
          "bitCompression": false,
          "segments": 0,
          "centroids": 256,
          "trainingLimit": 100000,
          "encoder": {
            "type": "kmeans",
            "distribution": "log-normal"
          }
        },
        "bq": {
          "enabled": false
        }
      },
      "vectorIndexType": "hnsw",
      "vectorizer": "text2vec-openai"
    }
  ]
}

I am getting error:


{
  "response": {
    "data": {
      "Get": {
        "Custcity": null
      }
    },
    "errors": [
      {
        "locations": [
          {
            "column": 6,
            "line": 1
          }
        ],
        "message": "explorer: get class: vectorize params: vectorize params: vectorize params: vectorize keywords: remote client vectorize: API Key: no api key found neither in request header: X-Openai-Api-Key nor in environment variable under OPENAI_APIKEY",
        "path": [
          "Get",
          "Custcity"
        ]
      }
    ],
    "status": 200,
    "headers": {}
  },
  "request": {
    "query": "{Get{Custcity(where:{operator:Equal,valueText:\"SCHEMA\",path:[\"trainingDataType\"]},nearText:{concepts:[\"Analyze the correlation between the number of activities (tasks and events) and opportunity win rates.\"],targetVectors:[\"content\"]},limit:8){content _additional { distance }}}}"
  }
}

You can follow discussion on weaviate slack: Slack

hi @Mihir_Kanzariya ! Welcome to our community :hugs:

I understand from the discussion in our slack that this may be a bug.

Can you open an issue in our Github?

Let me know if you need help on that.

With the issue open, we can expedite a fix internally.

Thanks!