BuilderIO / micro-agent

An AI agent that writes (actually useful) code for you
https://www.builder.io/blog/micro-agent
MIT License
2.41k stars 183 forks source link

Non ChatGPT token API's #46

Closed Uffynn closed 1 month ago

Uffynn commented 1 month ago

Is there a reason why when I place a non ChatGPT token API, that they are not functioning? I get a "401 Incorrect API key provided" error, even tho the provided token API is correct, but again not a ChatGPT one.

steve8708 commented 1 month ago

Sorry i'm not following what you're saying, can you elaborate? What is a "non chatgpt token API"? Do you mean a non-OpenAI key? If you are not using OpenAI then you need to supply a custom endpoint with OPENAI_API_ENDPOINT, for instance to use Groq or some other provider

Uffynn commented 1 month ago

That means that I am using any other AI's key, example: Lux, OpenRouter, Gemini, Perplexity or any other API Token that is free, unlike ChatGPTs.

Also when I use OPENAI_API_ENDPOINT as you have written here, I get invalid configuration. Also in the technical documentation there are no examples of the OPENAI_API_ENDPOINT.

steve8708 commented 1 month ago

If you are going to use an OPENAI_KEY you need to use an OpenAI compatible LLM that exposes its own endpoint, for example if you use Groq it would be https://api.groq.com/openai/v1. https://github.com/BuilderIO/micro-agent/blob/main/README.md#add-an-llm-api-key

Models like Gemini, tmk, are not OpenAI compatible