深入了解近期备受关注的免费 AI 模型 Quasar Alpha,其卓越性能、高人气原因,以及通过 OpenRouter API 进行调用的方法。
<dependency> <groupId>org.springframework.ai</groupId> <artifactId>spring-ai-openai-spring-boot-starter</artifactId> </dependency>
application.properties
application.yml
# OpenRouter 配置为 OpenAI 兼容模式 spring.ai.openai.base-url=https://openrouter.ai/api/v1 spring.ai.openai.api-key=sk-or-your-openrouter-key spring.ai.openai.chat.options.model=openrouter/quasar-alpha
@Autowired private ChatModel chatModel; @Test void contextLoads() { String call = chatModel.call("Hello, world!"); System.out.println(call); }