1.OpenRouter large model API aggregation platformConcept Introduction1.1 What is "OpenRouter"?2. Practical Operations2.1 Obtaining API Credentials2.2 Graphical Process2.3 Configuration File Modifications
OpenRouter is a large model API aggregation platform. You can think of it as a "universal remote control for large models." Typically, if you want to use OpenAI's GPT-4, Anthropic's Claude-3, and Google's Gemini, you need to register accounts on each platform, obtain three sets of API keys, and write three different sets of calling code for each of their different API formats.
OpenRouter solves this problem. It provides a unified API interface (compatible with OpenAI's API format). With just one OpenRouter API key, you can access all of these models, as well as hundreds of other open and closed-source models, through this single entry point.
The core advantages of integrating OpenRouter into largemodel projects are:
In the largemodel project, configure the llm_platform parameter to openrouter to enable this powerful aggregation platform.







large_model_interface.yaml:vim ~/yahboom_ws/src/largemodel/config/large_model_interface.yamlIn openrouter_api_key, replace sk-xxxxxxxxxx with the API key you copied earlier.
openrouter_model is used to configure the large model for communication.
xxxxxxxxxx# OpenRouter Platform Configurationopenrouter_api_key: "sk-xxxxxxxxxxxxxxxxxxx"openrouter_model: "moonshotai/kimi-k2:free" # Model to use, for example, "google/gemini-pro-vision"yahboom.yaml:xxxxxxxxxxvim ~/yahboom_ws/src/largemodel/config/yahboom.yamlllm_platform parameter to openrouter.xxxxxxxxxxllm_platform'openrouter'After switching the platform parameters, return to the workspace and compile again for the changes to take effect.