Skip to main content
Announcement bar — session-dismissible, edit or remove in home.ts

Portal API

Portal AI v1, called from this origin with the Portal JWT that portal-sso holds. Every call here is Bearer-only: there is no anonymous Portal API and no placeholder to fall back to.

GET
/api/ai/status

Configuration probe: is AI usable on this Portal at all?

No parameters. Consumes no tokens and makes no upstream call. Its configured is about Portal's OpenRouter key, not about this feature.

GET
/api/ai/models

The models this Portal will accept.

No parameters. Portal's approved list, not the full OpenRouter catalogue. Sending this also fills the model picker below.

POST
/api/ai/chat

Text chat completion.

The only v1 call that reaches OpenRouter, and the only one that costs the organisation money. Portal allows itself 120 s; the client aborts at 125 s so the server's own error wins the race and you get a code rather than a bare "aborted".

Request body
{
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful assistant."
    },
    {
      "role": "user",
      "content": "Say hello in one sentence."
    }
  ],
  "module": "portal-api-tester",
  "feature": "chat",
  "maxTokens": 256,
  "temperature": 0.2
}

Absent on purpose: /api/ai/admin/* is SystemAdmin and Portal-SPA only, and no website client may wrap it. Images, streaming and tool-calling are not in v1.