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.
No Portal is configured.
Set PUBLIC_PORTAL_URL and PUBLIC_OAUTH_CLIENT_ID in .env and rebuild — they are inlined at build time. Until then
every call below fails with portal_not_configured.
/api/ai/statusConfiguration 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.
/api/ai/modelsThe models this Portal will accept.
No parameters. Portal's approved list, not the full OpenRouter catalogue. Sending this also fills the model picker below.
/api/ai/chatText 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.