import { withToken } from "@/lib/api-tokens"; import { size, v1Json } from "@/lib/api-v1"; import { getGuardrails } from "@/lib/settings"; export const dynamic = "force-dynamic"; /** Who am I, what may I do, and within which limits. Any valid token. */ export const GET = withToken(null, async (_req, { token }) => { const g = await getGuardrails(); return v1Json({ token: { name: token.name, scopes: token.scopes }, guardrails: { approvalMode: g.approvalMode, maxRequestBytes: g.maxRequestBytes, maxRequestSize: size(g.maxRequestBytes), minFreeBytes: g.minFreeBytes, minFreeSize: size(g.minFreeBytes), maxOpenAgentJobs: g.maxOpenJobs, allowedAuthors: g.allowedAuthors, }, endpoints: [ "GET /api/v1/hub/lookup?repo=org/name[&revision=main][&files=all]", "GET /api/v1/models[?q=&author=&family=&quant=&tag=&status=&requested_by=]", "GET /api/v1/models/{id}", "POST /api/v1/downloads {repoId, sha, quant | include[], tags?, revision?}", "GET /api/v1/jobs/{id}[?log=50]", "GET /api/v1/disk", ], }); });