HarnessRouter Community Edition: the self-hosted, Apache-2.0 edition of the unified interface for agent harnesses. Run Codex, Claude Code, Hermes, PI, DSH, and more through one API, with sessions, streaming, files, cancellation, and failure handling. Implements the Unified Harness Protocol (UHP), an open standard. Your keys, your infrastructure.
Python agent-apiagent-frameworkagent-harnessai-agentsai-infrastructurecoding-agentconformance-testingdeepseek-harnessharness-engineeringhermesllmopen-protocolopen-sourceopen-standardpi-coding-agentself-hosteduhpunified-apiunified-harness-protocolunified-interface
// Who is signed in to this instance.
//
// The username can't be a NEXT_PUBLIC_* build-time constant: the image is built once and the
// credentials are set when it RUNS, so the client has to ask. Only the username is returned —
// it is a label, not a secret, and the password never leaves the server.
//
// Reaching this route at all means the middleware already validated the session.
import { AUTH_DISABLED, SELF_HOSTED } from '@/lib/selfhost-auth';
import { authUser } from '@/lib/selfhost-credentials';
export const runtime = 'nodejs';
export const dynamic = 'force-dynamic';
export async function GET() {
if (!SELF_HOSTED) return Response.json({ detail: 'not a self-hosted instance' }, { status: 404 });
return Response.json({ user: authUser(), gated: !AUTH_DISABLED });
}