feat(clients): openrouter: whole public API, spec-checked call table, chat model, demo

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-24 07:46:42 +02:00
co-authored by Claude Sonnet 5.5
parent 2e0270c043
commit 9a24bedc7c
54 changed files with 7109 additions and 3 deletions
@@ -0,0 +1,21 @@
// Routes: GET /ai/openrouter/status and /ai/openrouter/calls
#include "support/Assert.hpp"
using namespace molo::example::test;
int main() {
Fixture f;
auto res = f.client->get("/ai/openrouter/status");
check(res.status == 200, "status 200");
check(contains(res.body, "\"configured\":false"), "reports no API key");
check(contains(res.body, "\"management_configured\":false"), "reports no management key");
check(contains(res.body, "OPENROUTER_MANAGEMENT_KEY"), "names the management key variable");
check(contains(res.body, "\"calls\":140"), "reports the call count");
auto calls = f.client->get("/ai/openrouter/calls");
check(calls.status == 200, "calls 200");
check(contains(calls.body, "sendChatCompletionRequest") && contains(calls.body, "/chat/completions"), "table lists chat");
check(contains(calls.body, "\"key\":\"mgmt\""), "table lists management calls");
check(f.client->post("/ai/openrouter/status", "{}", "application/json").status == 405, "post is 405");
check(f.client->post("/ai/openrouter/calls", "{}", "application/json").status == 405, "calls post is 405");
return finish("ai/openrouter/status");
}