Search code examples
weaviate

How to add an openai API key in a weaviate GraphQL command on the cloud console?


I want to do a similiarity search like this:

{
  Get {
    ResultItem(
      limit:3
      nearText: {concepts: ["hacking attack on company"]}
    ) {
      title, url, snippet
    }
  }
}

This gives me the following error: "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",

The given string has to be vectorized in my case with openai. But how can I add the neccessary API key in the command on the cloud console?

In the weaviate cloud console where you can query your database I tried the above mentioned query. I expected to get max 3 results with their title, url and snippet.


Solution

  • You can set it in the header section as outlined here

    Weaviate Console API-keys