h@llo.ai -- cannot use openrouter

BTT version 6.639

My main LLM model provider is openrouter.ai. I don't know why but whenever I try to use it I get this error:

Using other tools or even curl with the same API key work fine...

are you sure the API key is correct? open router also returns that error for invalid keys

Yes, if I copy the key from BTT and paste it in a curl request, it works. Same key same model name, same API address.

I tried to use another assistant configured with a siliconflow.cn key i have, that one crashed BTT when it tried to respond. Crash attached

crash.zip (426.9 KB)

I may delete all my AI config and start from scratch, something seems very broken here...

possibly check whether the api key field contains an extra line or space (best cmd+a to select all, then delete)

I‘ll check your crashlog tomorrow!

No newlines unfortunately...

As I have both codex and opencode installed I can use those, though the response is much slower. For opencode I'm using the same openrouter key, so that key using BTT>opencode>openrouter works, but as an BTT>openai-API it fails.

Also, I tried to enable MCP servers, here is my btt-mcp-config.json:

{
	"mcpServers": {
		"bookends-mcp": {
			"command": ["/Applications/Bookends.app/Contents/MacOS/BookendsMCP/BookendsMCP"],
			"args": []
		},
		"codebase-memory-mcp": {
			"command": ["/Users/ian/.local/bin/codebase-memory-mcp"],
			"args": []
		},	
		"scrivener": {
			"command": ["/Users/ian/.pixi/bin/npx"],
			args: ["scrivener-mcp"]
		}
	}
}

In the docs it tells me I need to "activate" MCP but in skills section is missing the tools parts that the docs say I need to activate:

I suspect as I have MCP setup in opencode I don't need it in BTT, but if I can get the openai option working then I am back to no MCP servers...

OK, this may be something going wrong at the trigger-level. I have been testing using a keyboard trigger and this (my agent is called Flash)

I get the error. But I just tried this button for my agent:

...and it worked! This doesn't affect the CLI tools setup but does impact the API setup...