brianpetro / obsidian-smart-connections

Chat with your notes & see links to related content with AI embeddings. Use local models or 100+ via APIs like Claude, Gemini, ChatGPT & Llama 3
https://smartconnections.app
GNU General Public License v3.0
2.57k stars 174 forks source link

Invalid API Key OpenApi #519

Open joandervieira opened 6 months ago

joandervieira commented 6 months ago

I just installed the plugin and tried to put the OpenApi Key, but got error: "API Key is invalid!" I double checked my API key and it's correct ! The api key start with sk-1weG4.....

image

image

By the way, what means these fields ? should I change this ? image

brianpetro commented 6 months ago

@joandervieira OpenAI is requiring pre-paying for credits now. Doing so will solve the API key issue.

Those embedding models are a good start for local models. Since you're using OpenAI, you could try their models, too, and that will make the embedding process faster but will send your content to the OpenAI servers. So it just depends on your priorities, speed vs privacy.

mdmd-10 commented 6 months ago

error image

I'm having a similar issue.

huachuman commented 6 months ago

I had the same issue. I really dislike that OpenAI are requiring pre-pay for credits now.

mdmd-10 commented 6 months ago

I even paid the $5 dolars... but it didn't work anyways. Any more tips?

brianpetro commented 6 months ago

@mdmd-10 that screenshot doesn't look like Smart Connections plugin.

strandbygaard commented 5 months ago

@brianpetro I cannot get it to work with OpenAI project keys. The legacy user keys seem to work fine.

brianpetro commented 5 months ago

@strandbygaard I'm not sure what you mean by that 🌴

jmiba commented 4 months ago

@brianpetro I cannot get it to work with OpenAI project keys. The legacy user keys seem to work fine.

Same here. I created a new project and a project key and Smart Connections keeps complaining about an invalid API key.

hardchor commented 4 months ago

Updating the OpenAI API Key under "Smart Chat" with the new project-based API keys worked fine for me, but when I update the API key for embeddings, I'm getting this on the console:

saving setting: api_key
plugin:smart-connections:9178 rerendering view
plugin:smart-connections:6463 saved settings
plugin:smart-connections:6464 
{new_user: false, chat_folder: 'smart chat', smart_notes_embed_model: 'text-embedding-3-small', smart_blocks_embed_model: 'text-embedding-3-small', smart_connections_folder: '.smart-connections', …}
plugin:smart-connections:8251 Smart Connections: Error testing OpenAI API key TypeError: this.changed_smart_chat_model is not a function
    at SmartEmbedSettings.test_api_key_openai_embeddings (plugin:smart-connections:8245:24)
    at async ScSettings.test_api_key_openai_embeddings (plugin:smart-connections:8775:9)
test_api_key_openai_embeddings  @   plugin:smart-connections:8251
await in test_api_key_openai_embeddings (async)     
test_api_key_openai_embeddings  @   plugin:smart-connections:8775
handle_on_change    @   plugin:smart-connections:6542
await in handle_on_change (async)       
eval    @   plugin:smart-connections:6482
(anonymous) @   app.js:1