// Package swagger Code generated by swaggo/swag. DO NOT EDIT package swagger import "github.com/swaggo/swag" const docTemplate = `{ "schemes": {{ marshal .Schemes }}, "swagger": "2.0", "info": { "description": "{{escape .Description}}", "title": "{{.Title}}", "contact": { "name": "LocalAI", "url": "https://localai.io" }, "license": { "name": "MIT", "url": "https://raw.githubusercontent.com/mudler/LocalAI/master/LICENSE" }, "version": "{{.Version}}" }, "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { "/3d/animate": { "post": { "tags": [ "3d" ], "summary": "Creates a 3D animation (binary glTF / GLB).", "parameters": [ { "description": "Named conditioning inputs and model-specific parameters", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.Model3DAnimationRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/schema.OpenAIResponse" } } } } }, "/3d/generations": { "post": { "tags": [ "3d" ], "summary": "Creates a 3D asset (binary glTF / GLB) from a conditioning image.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.Model3DRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.OpenAIResponse" } } } } }, "/3d/remesh": { "post": { "consumes": [ "multipart/form-data" ], "produces": [ "model/gltf-binary" ], "tags": [ "3d" ], "summary": "Applies watertight print remeshing to an existing 3D asset.", "parameters": [ { "type": "string", "description": "3D model name", "name": "model", "in": "formData", "required": true }, { "type": "file", "description": "Source GLB", "name": "mesh", "in": "formData", "required": true }, { "type": "number", "description": "Detail size as percent of the source bounding-box diagonal (0.35–2.5; default 0.5)", "name": "detail", "in": "formData" } ], "responses": { "200": { "description": "Remeshed GLB", "schema": { "type": "file" } } } } }, "/api/addons/apps": { "get": { "description": "Returns the installed addons that are enabled, for every authenticated caller who holds the addons feature. The owner decides what a caller sees; hiding an entry is never the control, because every call the entry leads to is authorized again. Each app has its title, description, icon URL, version and installed generation, a process state (running, starting, failed or stopped; the state is an observation, separate from the enabled flag), the path of its main page when its manifest declares a valid one, and a bounded tool summary. A headless addon is listed without a main page. Administrators additionally see installed addons that are disabled and, per app, the start and stop controls and the management link. An app carries update update-pending, separate from state, only when the owner's cached update check says an update is available for the installed package; the list never evaluates a check and never reaches a library.", "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "List the addon apps the caller may use", "responses": { "200": { "description": "Apps visible to the caller", "schema": { "$ref": "#/definitions/apps.List" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature or owner policy denied the request", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons or the owner are unavailable", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/apps/{id}/icon": { "get": { "description": "Streams the immutable icon image of the app at the generation named in the query. The image comes from the verified package on the owner, relayed through the receiving frontend; it is never served from an addon process and never from a URL the manifest names. It is served only for an app the caller may see at the generation that was listed. An unknown app, a hidden app, an app without a verified icon and a stale generation give the same 403. The response is an image with X-Content-Type-Options nosniff and Cache-Control private, no-store.", "produces": [ "image/png", "image/webp", "image/jpeg" ], "tags": [ "Addons" ], "summary": "Read the icon of an addon app", "parameters": [ { "type": "string", "description": "Addon ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "Installed generation from the apps list", "name": "generation", "in": "query", "required": true } ], "responses": { "200": { "description": "Icon bytes", "schema": { "type": "string" }, "headers": { "Cache-Control": { "type": "string", "description": "private, no-store" }, "X-Content-Type-Options": { "type": "string", "description": "nosniff" } } }, "400": { "description": "Missing or malformed generation", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature denied, or the app is unknown, hidden, has no icon or the generation is stale", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons or the owner are unavailable", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/apps/{id}/start": { "post": { "description": "Administrators only. Records the desired state enabled through the same lifecycle manager and owner as the typed enable action; the owner starts the process and health stays a separate observation. The body carries the generation the caller saw in the apps list: a different installed generation is denied before anything is recorded. The operationId is the identity of the change: repeat it to replay safely, and after an outcome_unknown response poll operation-status with it instead of submitting a new operation. Non-administrators are denied (403) whatever the body says.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Start an addon app", "parameters": [ { "type": "string", "description": "Addon ID", "name": "id", "in": "path", "required": true }, { "description": "Operation and the generation the caller saw", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/apps.StartRequest" } } ], "responses": { "200": { "description": "Operation accepted; the payload is the operation status", "schema": { "$ref": "#/definitions/contract.Result" } }, "400": { "description": "Malformed body, missing operationId or generation", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature, administration or generation denied the request", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons or the owner are unavailable, or the outcome is unknown (type outcome_unknown, with operationId)", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/apps/{id}/stop": { "post": { "description": "Administrators only. Records the desired state disabled through the same lifecycle manager and owner as the typed disable action; the owner drains and stops the process and keeps all data. The body carries the generation the caller saw in the apps list: a different installed generation is denied before anything is recorded. The operationId is the identity of the change: repeat it to replay safely, and after an outcome_unknown response poll operation-status with it instead of submitting a new operation. Non-administrators are denied (403) whatever the body says.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Stop an addon app", "parameters": [ { "type": "string", "description": "Addon ID", "name": "id", "in": "path", "required": true }, { "description": "Operation and the generation the caller saw", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/apps.StartRequest" } } ], "responses": { "200": { "description": "Operation accepted; the payload is the operation status", "schema": { "$ref": "#/definitions/contract.Result" } }, "400": { "description": "Malformed body, missing operationId or generation", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature, administration or generation denied the request", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons or the owner are unavailable, or the outcome is unknown (type outcome_unknown, with operationId)", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/artifacts/{id}": { "get": { "description": "Returns the caller's own artifact: its state (transferring, complete, failed or cancelled), the sanitized file name, the media type, the exact size and the expiry. Only the principal that requested the result can read it; an unknown identifier and another user's artifact give the same 403, so identifiers cannot be probed. The response never carries a storage path or an addon handle. This is the status lookup of the background transfer; it is read-only.", "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Read the state of a private addon file result", "parameters": [ { "type": "string", "description": "Artifact ID (host generated, opaque)", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "Artifact state", "schema": { "$ref": "#/definitions/gateway.Artifact" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature denied, or the artifact is unknown, expired or not the caller's", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons or the owner are unavailable", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/artifacts/{id}/download": { "get": { "description": "Streams the caller's own complete artifact as an attachment, relayed through the receiving frontend from the owner that holds the bytes. Access needs the session or key of the principal that requested the result and, at the start and while streaming, current read access to every source resource and a current account. An artifact that is not complete, is expired, belongs to another principal or is unknown gives the same 403. The response is always an attachment (RFC 6266) with a sanitized name, a media type from a fixed allowlist or application/octet-stream, X-Content-Type-Options nosniff and Cache-Control private, no-store; it is never rendered inline. A failure after the first byte aborts the connection, so a truncated file never looks complete. Disabling the addon denies downloads and keeps the bytes until expiry; enabling it again serves unexpired artifacts to principals that still have access.", "produces": [ "application/octet-stream", "text/csv", "application/json" ], "tags": [ "Addons" ], "summary": "Download a private addon file result", "parameters": [ { "type": "string", "description": "Artifact ID (host generated, opaque)", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "Artifact bytes", "schema": { "type": "string" }, "headers": { "Cache-Control": { "type": "string", "description": "private, no-store" }, "Content-Disposition": { "type": "string", "description": "attachment with a sanitized filename and filename*" }, "Content-Length": { "type": "string", "description": "exact size of the artifact" }, "X-Content-Type-Options": { "type": "string", "description": "nosniff" } } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature denied, or the artifact is unknown, expired, incomplete, not the caller's or no longer readable by the caller", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons or the owner are unavailable, or the download bound is reached", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/builtin": { "get": { "description": "Returns the page add-ons that ship inside the web bundle. The list is empty today: Studio and Talk are packaged add-ons that a person installs from the Add-ons drawer. Each entry carries only its own gate: the route needs an authenticated caller and no ` + "`" + `addons` + "`" + ` feature.", "produces": [ "application/json" ], "tags": [ "AddonNavigation" ], "summary": "List the built-in add-ons the caller may open", "responses": { "200": { "description": "Entries the caller may open", "schema": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/builtin.Entry" } } } }, "401": { "description": "Authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/conversations/{conversationId}/selection/{addonId}": { "get": { "description": "Returns the resource the authenticated user selected for the conversation and add-on, with the user's current role and display name. The stored reference is keyed by the authenticated user, the conversation and the add-on, and is never a credential: the owner authorizes it again on every use. A reference that was revoked, deleted or never set is one answer: 404 not_selected. Another user's selection of the same conversation ID is never visible. Read-only. No MCP tool maps to this route.", "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Read the resource selected for a conversation", "parameters": [ { "type": "string", "description": "Conversation ID", "name": "conversationId", "in": "path", "required": true }, { "type": "string", "description": "Add-on ID", "name": "addonId", "in": "path", "required": true } ], "responses": { "200": { "description": "The selection", "schema": { "$ref": "#/definitions/gateway.Selection" } }, "400": { "description": "Malformed conversation or add-on ID", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature denied", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "404": { "description": "Type not_selected", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons or the owner are unavailable", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } }, "put": { "description": "Stores which resource the authenticated user chose for the conversation and add-on, so that chat tool calls that name no resource use it. The caller must hold at least the viewer role on the resource now; the stored reference is never a bearer and is authorized again at the owner on every use. It is not process-global, not shared between users or conversations, and not part of the chat history. The store is bounded per user and expires unused entries. No MCP tool maps to this route.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Select the resource a conversation works on", "parameters": [ { "type": "string", "description": "Conversation ID", "name": "conversationId", "in": "path", "required": true }, { "type": "string", "description": "Add-on ID", "name": "addonId", "in": "path", "required": true }, { "description": "The resource", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/gateway.SelectionRequest" } } ], "responses": { "200": { "description": "The selection", "schema": { "$ref": "#/definitions/gateway.Selection" } }, "400": { "description": "Malformed IDs or body", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature denied, or the resource is unknown or not readable by the caller", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons or the owner are unavailable", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } }, "delete": { "description": "Removes the authenticated user's selection for the conversation and add-on. Clearing a selection that does not exist succeeds. No MCP tool maps to this route.", "tags": [ "Addons" ], "summary": "Clear the resource selected for a conversation", "parameters": [ { "type": "string", "description": "Conversation ID", "name": "conversationId", "in": "path", "required": true }, { "type": "string", "description": "Add-on ID", "name": "addonId", "in": "path", "required": true } ], "responses": { "204": { "description": "Cleared" }, "400": { "description": "Malformed conversation or add-on ID", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature denied", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons or the owner are unavailable", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/dispatch": { "post": { "description": "Authenticates the named caller, checks the addons feature, requires administration for every action except read, and forwards the typed request to the designated addon owner. A mutation is never retried: after an outcome_unknown response keep the operationId and poll operation-status instead of submitting a new mutation. Lifecycle actions are install, upgrade, enable, disable and uninstall (arguments sourceId and version; enable and disable take the generation that was listed). The management reads, all administrator-only and never mutations, are catalog-search (arguments text, kind, sourceId, offset, limit up to 100; kind is addon by default, or backend, or all), catalog-details (addonId plus arguments sourceId and version), catalog-sources and addons-installed. The library changes are catalog-source-save (arguments are one source: id, name, url, enabled, policy, authReference; removed true deletes it and never touches installed addons) and catalog-source-refresh (argument sourceId). A library names a credential only by a reference the owner configured, never a secret. Unknown argument fields are denied. The update actions are update-status and update-check (no arguments; the check fetches the library again and applies nothing) and update-upgrade (arguments expectedDigest and candidateDigest, the pinned upgrade); each answers with a payload {error: {type, message, status}} or {data}, the same from every frontend. The browser pages use the dedicated routes under /api/addons/{id}/update and /api/addons/{id}/upgrade, which accept only an administrator's own browser session.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Submit a typed addon lifecycle operation or read an addon resource", "parameters": [ { "description": "Typed addon request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/contract.Request" } } ], "responses": { "200": { "description": "Operation accepted or read result", "schema": { "$ref": "#/definitions/contract.Result" } }, "400": { "description": "Malformed or unknown request fields, or type invalid_request when the add-on refused the request as invalid: nothing was applied and the same call is refused again", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature, administration or owner policy denied the request, or type sdk_incompatible when an install is refused because the add-on needs another SDK version: the message names the range the add-on needs and the SDK version the host provides. An install or upgrade that failed before anything was installed has the type of its cause: library_unavailable (the library could not be read), library_conflict (two enabled libraries list the add-on), release_not_found (the library does not list the release for this platform), package_fetch_failed (the package could not be downloaded) or install_storage_failed (the verified package could not be written to the add-on storage). Repeat it with a new operationId after you correct the cause", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons or the owner are unavailable, or the outcome of a mutation is unknown (type outcome_unknown, with operationId)", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/pins": { "get": { "description": "Returns the ordered add-on IDs the caller pinned to the sidebar. The route never pins anything by itself; Studio and Talk are pinned once, at upgrade, for the accounts that existed then. The list holds only IDs the caller may see right now: a hidden or removed add-on is left out and the route does not reveal whether it exists. Needs an authenticated caller and no administrator role.", "produces": [ "application/json" ], "tags": [ "AddonNavigation" ], "summary": "List the add-ons the caller pinned", "responses": { "200": { "description": "Ordered add-on IDs", "schema": { "type": "array", "items": { "type": "string" } } }, "401": { "description": "Authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "The pin store is unavailable", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } }, "put": { "description": "Replaces the caller's pins with the ordered list in the body. IDs the caller may not see are dropped without any hint, and pins that are only hidden for now are kept. At most 32 IDs are accepted. Needs an authenticated caller from a same-origin browser request or a credential header, and no administrator role.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "AddonNavigation" ], "summary": "Replace the add-ons the caller pinned", "parameters": [ { "description": "Ordered add-on IDs", "name": "pins", "in": "body", "required": true, "schema": { "type": "array", "items": { "type": "string" } } } ], "responses": { "200": { "description": "The saved list the caller can see", "schema": { "type": "array", "items": { "type": "string" } } }, "400": { "description": "Not a list of strings, or longer than 32", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "401": { "description": "Authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "The pin store or the add-on owner is unavailable", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/proposals": { "get": { "description": "Returns the caller's proposals that still wait for a human decision, newest first, at most 32, each with its state, exact effect count, bounded sample, digest and expiry. This is where a change proposed by a chat tool, an agent or a scheduled job waits: only the proposer's own browser session can confirm it. A proposal of another user is never listed, and an expired one is left out. Read-only: it applies nothing. API keys may call it so an unattended agent can see what is waiting; they still cannot confirm.", "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "List the caller's own pending addon proposals", "parameters": [ { "enum": [ "pending" ], "type": "string", "description": "Only pending is supported", "name": "state", "in": "query", "required": true } ], "responses": { "200": { "description": "The caller's pending proposals", "schema": { "$ref": "#/definitions/gateway.PendingList" } }, "400": { "description": "Missing or unsupported state filter", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature denied", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons or the owner are unavailable", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } }, "post": { "description": "A request with action create and no resourceId proposes the creation of a resource: the owner reserves a pending resource for the caller that nobody can reach, shows the requested name, and creates it only on confirmation by the proposer's browser session. Previews the mutation on the addon owner and stores it as a pending proposal with its exact effect count, a bounded sample, the revisions it saw and an expiry. Nothing is applied. The operationId becomes the proposal ID; repeating the same request returns the same proposal. Sharing and database deletion are never proposals. A named session or API key with the addons feature may propose; the proposal can only be applied by Confirm, which requires the proposer's own browser session. No MCP tool confirms a proposal.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Propose an addon data or schema mutation, or a resource creation, for confirmation", "parameters": [ { "description": "Typed write, schema or create request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/contract.Request" } } ], "responses": { "200": { "description": "Stored proposal", "schema": { "$ref": "#/definitions/gateway.Proposal" } }, "400": { "description": "Malformed or unknown request fields, or type invalid_request when the add-on refused the request as invalid: nothing was applied and the same call is refused again", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature, resource policy or request binding denied the proposal. Type outcome_blocked (with blockedBy) when the caller is the owner role of the resource and another operation on it has an unresolved outcome; other callers get the plain denial", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons or the owner are unavailable. Type outcome_unknown (with operationId): the proposal had been handed to the addon and its outcome is unknown, reconcile it. Type proposal_unavailable (with operationId): the owner could not serve this call and this call sent nothing to the addon; read the proposal for its state, which may already be settled, and repeat the same call with the same ID", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/proposals/{id}": { "get": { "description": "Returns the caller's own proposal with its state, effects, receipt and, for a pending proposal that is blocked, the operation to resolve first. Expiry is recorded when a pending proposal is read after its expiry.", "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Read a stored addon proposal", "parameters": [ { "type": "string", "description": "Proposal ID (the operation ID)", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "Stored proposal", "schema": { "$ref": "#/definitions/gateway.Proposal" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature denied, or the proposal is not the caller's", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons or the owner are unavailable", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/proposals/{id}/cancel": { "post": { "description": "Withdraws the caller's pending proposal. A cancelled, expired or settled proposal can never run. Cancelling needs only a current identity.", "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Cancel a pending addon proposal", "parameters": [ { "type": "string", "description": "Proposal ID (the operation ID)", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "Cancelled proposal", "schema": { "$ref": "#/definitions/gateway.Proposal" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature denied, the proposal is not the caller's, or it is not pending", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons or the owner are unavailable. Type outcome_unknown (with operationId): the proposal had been handed to the addon and its outcome is unknown, reconcile it. Type proposal_unavailable (with operationId): the owner could not serve this call and this call sent nothing to the addon; read the proposal for its state, which may already be settled, and repeat the same call with the same ID", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/proposals/{id}/confirm": { "post": { "description": "Applies exactly the stored operation once. This is the only way a stored mutation reaches an addon. It is accepted only from the proposer's own browser session: a same-origin fetch from the host UI that carries the X-LocalAI-Confirm header equal to the proposal ID and the digest of what was shown. API keys, bearer tokens, MCP sessions and requests that carry tool or agent execution markers are refused, and no MCP tool maps to this route. A repeated confirmation returns the stored receipt. If the reply is lost the outcome is outcome_unknown with the original operationId; resolve it with reconcile and never submit the change again.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Confirm and apply a pending addon proposal", "parameters": [ { "type": "string", "description": "Proposal ID (the operation ID)", "name": "id", "in": "path", "required": true }, { "description": "Digest of the displayed proposal", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/addons.ConfirmRequest" } } ], "responses": { "200": { "description": "Proposal after the apply, with its receipt", "schema": { "$ref": "#/definitions/gateway.Proposal" } }, "400": { "description": "Malformed or unknown request fields, or type invalid_request when the add-on refused the request as invalid: nothing was applied and the same call is refused again", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Not a human confirmation surface, feature denied, or the proposal is not pending, is expired, stale, changed or blocked", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons or the owner are unavailable. Type outcome_unknown (with operationId): the proposal had been handed to the addon and its outcome is unknown, reconcile it. Type proposal_unavailable (with operationId): the owner could not serve this call and this call sent nothing to the addon; read the proposal for its state, which may already be settled, and repeat the same call with the same ID", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/proposals/{id}/reconcile": { "post": { "description": "Looks the operation's receipt up on the owner and records a committed or rejected result. It never applies anything and can be repeated. Use it after an outcome_unknown response. While an outcome is unresolved, other writes on the same resource are denied.", "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Resolve the outcome of an addon proposal by receipt lookup", "parameters": [ { "type": "string", "description": "Proposal ID (the operation ID)", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "Proposal after the lookup", "schema": { "$ref": "#/definitions/gateway.Proposal" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature denied or the proposal is not the caller's", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons, the owner or the addon runtime are unavailable", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/proposals/{id}/resolve": { "post": { "description": "Explicit recovery for an operation whose receipt cannot be found. After outcome_unknown, repeated reconcile calls and the automatic lookups that did not settle it, the owner role of the resource may record that the outcome is not worth waiting for. The proposal becomes abandoned-unknown with the acting owner, the time and the stated reason, and stops blocking writes on the resource. The operation is never submitted again, and a later receipt lookup that says it ran is recorded as applied. The owner is asserting that waiting is not worth it: a change that did run stays in the data, and the revision check of later changes protects against applying on a stale view. Accepted only from a host confirmation surface with the same rules as confirm: the owner's own browser session, a same-origin fetch, the X-LocalAI-Confirm header equal to the proposal ID, and no tool, agent or MCP marker. Installation administrators and API keys have no access through this route, and no MCP tool maps to it.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Abandon an unresolved addon proposal outcome as the resource owner", "parameters": [ { "type": "string", "description": "Proposal ID (the operation ID)", "name": "id", "in": "path", "required": true }, { "description": "Digest of the displayed proposal and the reason", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/addons.ResolveRequest" } } ], "responses": { "200": { "description": "Proposal after the acknowledgement, or settled by a final receipt", "schema": { "$ref": "#/definitions/gateway.Proposal" } }, "400": { "description": "Malformed or unknown request fields, or type invalid_request when the add-on refused the request as invalid: nothing was applied and the same call is refused again", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Not a human confirmation surface, not the resource owner, feature denied, digest changed or the proposal is not unresolved", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons or the owner are unavailable. Always type proposal_unavailable (with operationId), whoever proposed the operation, because resolving is not an apply: the owner could not serve this call and it sent nothing to the addon; read the proposal for its state and repeat the same call with the same ID", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/relay": { "post": { "description": "Streams the response of the designated addon owner through the receiving frontend, bounded per kind by the configured byte and time limits. The kind selects the response: status (JSON), progress (text/event-stream), json, file (a private file result as an attachment: the handle is the artifact ID that a read returned, never an addon handle) or asset (text/javascript or text/css). An owner decision made before the first byte is returned with the same status from every frontend; a failure after the first byte aborts the stream.", "consumes": [ "application/json" ], "produces": [ "application/json", "text/event-stream", "application/octet-stream", "text/javascript", "text/css" ], "tags": [ "Addons" ], "summary": "Relay addon status, lifecycle progress, JSON, attachments or immutable UI assets", "parameters": [ { "description": "Relay request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/gateway.RelayRequest" } } ], "responses": { "200": { "description": "Relayed response body", "schema": { "type": "string" } }, "400": { "description": "Malformed or unknown request fields, or type invalid_request when the add-on refused the request as invalid: nothing was applied and the same call is refused again", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature or owner policy denied the request", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons or the owner are unavailable", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/resources": { "get": { "description": "Returns the resources of one add-on that the caller owns or that were shared with the caller, each with the caller's own role, the display name the add-on reported (empty when it could not answer in time), the owner's display name for a shared resource and, for the owner role only, how many people it is shared with and the revision to send back with a rename or a delete. Resources of other people that are not shared with the caller are never listed, whatever the caller's installation role: installation administration is not data access. The answer also carries the installed generation, whether sharing is possible (false in local-owner mode) and the management operations the add-on supports. At most 100 resources are listed (truncated says more exist). Read-only. API keys may call it. No MCP tool maps to this route.", "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "List the add-on resources the caller may use", "parameters": [ { "type": "string", "description": "Add-on ID", "name": "addonId", "in": "query", "required": true } ], "responses": { "200": { "description": "Resources the caller may use", "schema": { "$ref": "#/definitions/gateway.ResourceList" } }, "400": { "description": "Missing or malformed add-on ID", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature denied", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons, the owner or the add-on are unavailable", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } }, "post": { "description": "Creates a resource through the add-on's create tool as the person's own explicit action, for example a new database. It needs no confirmation card: the request is the intent, and the same admission, quota, receipt and crash reconciliation rules as every mutation apply. The caller becomes the owner and the resource is private. Repeating the same operationId returns the same resource and never creates a second one; after outcome_unknown repeat the same call. The arguments are validated against the add-on's own tool definition. Accepted only from the person's own browser session: a same-origin fetch whose X-LocalAI-Confirm header equals the operationId, with no API key and no tool, agent or MCP marker. No MCP tool maps to this route.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Create an add-on resource (UI only)", "parameters": [ { "description": "Create request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/gateway.CreateResourceRequest" } } ], "responses": { "200": { "description": "The created resource", "schema": { "$ref": "#/definitions/gateway.ResourceInfo" } }, "400": { "description": "Malformed request or arguments the add-on's tool does not accept", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Not a human surface, feature or creation authority denied, or type quota_reached", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "409": { "description": "Type stale: the generation is not the installed one", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Unavailable, or type outcome_unknown (with operationId) after which the same call is repeated", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/resources/{resourceId}/apply": { "post": { "description": "Applies one change through a write or schema tool the add-on declares, for example inserting rows or adding a column, as the person's own explicit action in the person's own browser tab. It needs no confirmation card: the request is the intent. It is not a proposal and nothing is stored for later. The same rules as every change apply: the role of the action (the owner and editors write rows, only the owner changes the schema, viewers and installation administrators without a grant get the answer of an unknown resource), the declared tool definition, the resource's admission, the generation and the revision the caller read (409 stale, nothing changed), the add-on's receipt, which makes repeating the same operationId with the same request one change, and a wait behind an unresolved outcome. The tool's arguments must not name the resource, the tool, an actor or any field the tool definition does not declare. Reads, creations, the add-on's rename and delete, administrator tools and tools nobody declared are refused with 400. Accepted only from the person's own browser session: a same-origin fetch whose X-LocalAI-Confirm header equals the resource ID, with no API key and no tool, agent or MCP marker. After outcome_unknown, look the receipt up with kind=apply and the original operationId; never submit a new operation. No MCP tool maps to this route.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Change a resource's data or schema by the person's own action (UI only)", "parameters": [ { "type": "string", "description": "Resource ID", "name": "resourceId", "in": "path", "required": true }, { "description": "Change request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/gateway.ApplyResourceRequest" } } ], "responses": { "200": { "description": "The committed change and its receipt", "schema": { "$ref": "#/definitions/gateway.ApplyResult" } }, "400": { "description": "Malformed request, a tool that is not a change, or arguments the tool does not accept", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Not a human surface, feature denied, role too low or unknown resource, or type outcome_blocked", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "409": { "description": "Type stale: the generation or the revision moved", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Unavailable, or type outcome_unknown (with operationId)", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/resources/{resourceId}/changes/{changeId}/undo": { "post": { "description": "Rolls back one change an add-on tool made at once from a chat, an agent or a trigger, by the change set the add-on kept for it. The change ID is the one the tool result named. It is the person's own action in the person's own browser tab and never a tool: no model, agent, API key or MCP session can call it, so a model cannot undo its own work or anyone else's. The role it needs is the role the change needed: owners and editors undo a data change, only the owner role undoes a schema change or the creation of a database. The undo is one more recorded change, applied against the revision the add-on just reported: if the resource moved on after the change (any later revision) the answer is 409 with type stale and the words of what changed, and nothing is overwritten. The other refusals are typed too: not_found (404: never kept, too large to keep, or dropped), expired (410: past the retention of 7 days), already_undone (409) and cannot_undo (409: the work it started has finished). Repeating the same operationId with the same change returns the same result and undoes once; after outcome_unknown, look the receipt up with kind=undo. The undo of a creation deletes the database, only while nothing touched it since. Accepted only from the person's own browser session: a same-origin fetch whose X-LocalAI-Confirm header equals the resource ID, with no API key and no tool, agent or MCP marker. No MCP tool maps to this route.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Undo a change a chat made at once (UI only)", "parameters": [ { "type": "string", "description": "Resource ID", "name": "resourceId", "in": "path", "required": true }, { "type": "string", "description": "Change ID: the operation ID of the change, as named by the tool result", "name": "changeId", "in": "path", "required": true }, { "description": "Undo request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/gateway.UndoRequest" } } ], "responses": { "200": { "description": "The committed undo", "schema": { "$ref": "#/definitions/gateway.UndoResult" } }, "400": { "description": "Malformed request", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Not a human surface, feature denied, role too low or unknown resource, or type outcome_blocked", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "404": { "description": "Type not_found", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "409": { "description": "Type stale (the data moved on after the change, or the generation moved), already_undone, cannot_undo or operation_conflict", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "410": { "description": "Type expired", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Unavailable, or type outcome_unknown (with operationId)", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/resources/{resourceId}/delete": { "post": { "description": "Permanently deletes the resource, its data and every grant, as the owner's own explicit action. It is never a chat operation and never an uninstall. The request must carry the generation and revision the owner listed and confirm, which must equal the resource's display name exactly. The owner marks the resource as deleting (inaccessible to everyone, no new admission), stops and waits for admitted work, checks the revision, cancels pending proposals, asks the add-on to delete and only then removes the record and the grants. A crash leaves a deleting record that the owner finishes at startup; an unconfirmed one returns to use. A 503 with type outcome_unknown means the deletion is confirmed and being finished: repeat the same call, the resource is inaccessible meanwhile. Accepted only from the owner's own browser session (same-origin fetch, X-LocalAI-Confirm equal to the resource ID). No MCP tool maps to this route and the add-on's delete tool is not offered to any model.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Delete a resource and its data (owner, UI only)", "parameters": [ { "type": "string", "description": "Resource ID", "name": "resourceId", "in": "path", "required": true }, { "description": "Delete request with the typed confirmation", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/gateway.DeleteResourceRequest" } } ], "responses": { "200": { "description": "Deleted", "schema": { "$ref": "#/definitions/gateway.DeleteResult" } }, "400": { "description": "Malformed request, wrong confirmation or unsupported operation", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Not a human surface, feature denied, not the owner role or unknown resource, or type outcome_blocked", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "409": { "description": "Type stale", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Unavailable, or type outcome_unknown (with operationId)", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/resources/{resourceId}/grants": { "get": { "description": "Returns the grants of the whole resource: the immutable account ID, the display name and the role of each grantee. Only the owner role of the resource may read it; installation administrators, editors and viewers get the same denial as for an unknown resource. Local-owner mode has no sharing and answers 409 sharing_disabled. Accepted only from the owner's own browser session (same-origin fetch, X-LocalAI-Confirm equal to the resource ID). No MCP tool maps to this route.", "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "List who a resource is shared with (owner, UI only)", "parameters": [ { "type": "string", "description": "Resource ID", "name": "resourceId", "in": "path", "required": true } ], "responses": { "200": { "description": "Grants of the resource", "schema": { "$ref": "#/definitions/gateway.GrantList" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Not a human surface, feature denied, not the owner role or unknown resource", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "409": { "description": "Type sharing_disabled", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons or the owner are unavailable", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/resources/{resourceId}/grants/{userId}": { "put": { "description": "Gives the user the viewer or editor role on the whole resource; there are no per-table grants and the owner role cannot be granted. The user is named by the immutable account ID the user picker returned, and must be an active named account that may use add-ons. Lowering a role stops the user's admitted work and cancels the user's pending proposals before it is acknowledged. Local-owner mode answers 409 sharing_disabled. Accepted only from the owner's own browser session (same-origin fetch, X-LocalAI-Confirm equal to the resource ID). Safe to repeat; after outcome_unknown repeat the same call. No MCP tool maps to this route: sharing is never a tool.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Share a whole resource with a named user (owner, UI only)", "parameters": [ { "type": "string", "description": "Resource ID", "name": "resourceId", "in": "path", "required": true }, { "type": "string", "description": "Account ID of the grantee", "name": "userId", "in": "path", "required": true }, { "description": "Role", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/gateway.SetGrantRequest" } } ], "responses": { "200": { "description": "Grants after the change", "schema": { "$ref": "#/definitions/gateway.GrantList" } }, "400": { "description": "Malformed body or role", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Not a human surface, feature denied, not the owner role, unknown resource or a user that cannot be granted", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "409": { "description": "Type sharing_disabled", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Unavailable, or type outcome_unknown (with operationId)", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } }, "delete": { "description": "Removes the user's grant. It returns only after the user's admitted work stopped and their pending proposals were cancelled; a drain that did not finish in the bound is a 503 and the revocation is already effective for new work. Local-owner mode answers 409 sharing_disabled. Accepted only from the owner's own browser session (same-origin fetch, X-LocalAI-Confirm equal to the resource ID). Safe to repeat. No MCP tool maps to this route.", "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Stop sharing a resource with a user (owner, UI only)", "parameters": [ { "type": "string", "description": "Resource ID", "name": "resourceId", "in": "path", "required": true }, { "type": "string", "description": "Account ID of the grantee", "name": "userId", "in": "path", "required": true }, { "type": "string", "description": "Optional operation ID, returned with outcome_unknown", "name": "operationId", "in": "query" } ], "responses": { "200": { "description": "Grants after the change", "schema": { "$ref": "#/definitions/gateway.GrantList" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Not a human surface, feature denied, not the owner role or unknown resource", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "409": { "description": "Type sharing_disabled", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Unavailable, or type outcome_unknown (with operationId)", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/resources/{resourceId}/operations/{operationId}": { "get": { "description": "Read-only receipt lookup after an outcome_unknown answer. kind is rename (operationId is the one the rename carried), delete, apply or undo (the operationId of a change or of an undo; any role that may write looks up its own). The state is pending, committed, rejected or unknown; it never applies anything. The owner role may look up a rename or a deletion and the roles that may write look up their own changes, from the owner's own browser session (same-origin fetch, X-LocalAI-Confirm equal to the resource ID). After a deletion finished the resource is gone and the lookup is denied like any unknown resource. No MCP tool maps to this route.", "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Look up the receipt of a rename or a deletion (owner, UI only)", "parameters": [ { "type": "string", "description": "Resource ID", "name": "resourceId", "in": "path", "required": true }, { "type": "string", "description": "Operation ID of the rename", "name": "operationId", "in": "path", "required": true }, { "enum": [ "rename", "delete", "apply", "undo" ], "type": "string", "description": "Operation kind", "name": "kind", "in": "query", "required": true }, { "type": "string", "description": "Apply only: the requestHash of the request the caller means (64 lowercase hex). A lookup whose hash is not the one the operation ID was used for is a 409 operation_conflict, never the other request's receipt", "name": "requestHash", "in": "query" } ], "responses": { "200": { "description": "Receipt state", "schema": { "$ref": "#/definitions/gateway.OperationStatus" } }, "400": { "description": "Unsupported kind or malformed requestHash", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Not a human surface, feature denied, not the owner role or unknown resource", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "409": { "description": "Type operation_conflict: the operation ID belongs to another request", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons, the owner or the add-on are unavailable", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/resources/{resourceId}/proposals": { "get": { "description": "Returns the proposals on the resource whose outcome is unresolved (executing, outcome-unknown) or abandoned-unknown, whoever proposed them, so the resource owner can learn the operation ID and digest that resolve needs. Each entry has the proposal ID, state, the proposing user, the action, the exact effect count and the bounded effect sample the proposer saw, the expiry, the digest and the age in seconds. It never returns the proposed arguments or any credential. Read-only. Only the owner role of the resource may call it; installation administrators, editors and viewers are denied. It is accepted only from a host confirmation surface with the rules of resolve: the owner's own browser session, a same-origin fetch, the X-LocalAI-Confirm header equal to the resource ID, and no tool, agent or MCP marker. API keys are refused and no MCP tool maps to this route.", "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "List the unresolved addon proposals of a resource as its owner", "parameters": [ { "type": "string", "description": "Resource ID", "name": "resourceId", "in": "path", "required": true }, { "enum": [ "unresolved" ], "type": "string", "description": "Only unresolved is supported", "name": "state", "in": "query", "required": true } ], "responses": { "200": { "description": "Unresolved proposals, oldest first", "schema": { "$ref": "#/definitions/gateway.ProposalList" } }, "400": { "description": "Missing or unsupported state filter", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Not a human confirmation surface, not the owner role of the resource, feature denied or unknown resource", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons or the owner are unavailable", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/resources/{resourceId}/rename": { "post": { "description": "Renames the resource through the add-on as the owner's own explicit action, with no confirmation card. It still runs under the resource's admission, waits behind an unresolved outcome (403 outcome_blocked for the owner role), is checked against the generation and the revision the owner listed (409 stale, nothing changed) and leaves the add-on's receipt for the operation. Repeating the same operationId never renames twice; after outcome_unknown repeat the same call or look it up with the operation status route. Accepted only from the owner's own browser session (same-origin fetch, X-LocalAI-Confirm equal to the resource ID). No MCP tool maps to this route.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Rename a resource (owner, UI only)", "parameters": [ { "type": "string", "description": "Resource ID", "name": "resourceId", "in": "path", "required": true }, { "description": "Rename request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/gateway.RenameResourceRequest" } } ], "responses": { "200": { "description": "The renamed resource", "schema": { "$ref": "#/definitions/gateway.ResourceInfo" } }, "400": { "description": "Malformed request or a name the add-on refuses", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Not a human surface, feature denied, not the owner role or unknown resource, or type outcome_blocked", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "409": { "description": "Type stale", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Unavailable, or type outcome_unknown (with operationId)", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/resources/{resourceId}/users": { "get": { "description": "Finds active named accounts that may use add-ons by a prefix of the display name or of the address, 2 to 64 characters, at most 20 results. Each result is an immutable account ID and a display name and nothing else. Only the owner role of the resource may search; the owner and the caller are left out. Local-owner mode answers 409 sharing_disabled. Accepted only from the owner's own browser session (same-origin fetch, X-LocalAI-Confirm equal to the resource ID). No MCP tool maps to this route.", "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Search the people a resource can be shared with (owner, UI only)", "parameters": [ { "type": "string", "description": "Resource ID", "name": "resourceId", "in": "path", "required": true }, { "type": "string", "description": "Name or address prefix", "name": "q", "in": "query", "required": true }, { "type": "integer", "description": "At most this many results, up to 20", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "Matching people", "schema": { "$ref": "#/definitions/gateway.UserList" } }, "400": { "description": "Query too short or too long", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Not a human surface, feature denied, not the owner role or unknown resource", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "409": { "description": "Type sharing_disabled", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons or the owner are unavailable", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/{id}/assets/{digest}/{path}": { "get": { "description": "Streams one file the addon manifest declares as UI code (the entry module or a style sheet) from the verified package on the owner, relayed through the receiving frontend. The digest in the path is the sha256 of the installed package, in lower-case hex, as listed in the ui entry of the apps list. The file is served only while the addon is installed and enabled and the digest is the current one; a file the manifest does not declare, a traversal, a directory, another addon, an older package, a disabled or uninstalled addon and a missing feature all give a denial without any file content, and a denial is never cached. The response is text/javascript or text/css with X-Content-Type-Options nosniff and Cache-Control private, max-age=31536000, immutable: the URL changes with the package, so the file never changes under it. The caller is authenticated by an API key header or by the same-origin browser session; a credential in the URL is never accepted. The addon process is never asked.", "produces": [ "text/javascript", "text/css" ], "tags": [ "Addons" ], "summary": "Read an immutable file of an addon UI package", "parameters": [ { "type": "string", "description": "Addon ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Package digest, 64 lower-case hex characters", "name": "digest", "in": "path", "required": true }, { "type": "string", "description": "Declared package file, for example ui.js", "name": "path", "in": "path", "required": true } ], "responses": { "200": { "description": "File bytes", "schema": { "type": "string" }, "headers": { "Cache-Control": { "type": "string", "description": "private, max-age=31536000, immutable" }, "X-Content-Type-Options": { "type": "string", "description": "nosniff" } } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature denied, or the file, addon or package digest is not currently served", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons or the owner are unavailable", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/{id}/purge": { "post": { "description": "Administrators only, from their own browser session, with the add-on ID typed as confirm. Removes retained data the scope names: the add-on's data and the owner's records of its resources and shares (data), its backups (backups) and the data copies that restores and failed upgrades set aside (recoveryCopies). The add-on must be uninstalled or disabled. It is not the deletion of a database and not an uninstall; those never remove retained data. The purge is journaled and finished after a crash, and it touches no other add-on. No MCP tool maps to this route.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Purge the retained data of an add-on (administrators, browser session)", "parameters": [ { "type": "string", "description": "Add-on ID", "name": "id", "in": "path", "required": true }, { "description": "Operation, scope and confirmation", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/addons.RecoveryPurgeRequest" } } ], "responses": { "200": { "description": "What was purged, with warnings", "schema": { "$ref": "#/definitions/recovery.PurgeReceipt" } }, "400": { "description": "Malformed request, empty scope or type confirmation_mismatch", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature, administration or browser session denied", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "409": { "description": "Type addon_running, operation_conflict or busy", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Unavailable, or outcome_unknown (with operationId)", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/{id}/recovery": { "get": { "description": "Administrators only. Returns the recovery state of the add-on's data (ready, upgrading, restoring, needs-recovery or purging) with its reason, the backups newest first with their size, creation time, reason (manual, upgrade or restore), the ownership mode and package version they hold and the last recorded verification result (verified, failed or unverified), the backup that is the recovery copy, the receipt and warnings of the last restore, the retention policy, the number of data copies a restore set aside and the operation IDs whose result is recorded. Read-only. No MCP tool maps to this route.", "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Read the data recovery state and the backups of an add-on (administrators)", "parameters": [ { "type": "string", "description": "Add-on ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "Recovery state", "schema": { "$ref": "#/definitions/recovery.Status" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature or administration denied", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons or the owner are unavailable", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/{id}/recovery/backup": { "post": { "description": "Administrators only, from their own browser session (same-origin fetch, X-LocalAI-Confirm equal to the operationId). Blocks new admission for the add-on's resources, invalidates its pending proposals, drains admitted work, stops the add-on, makes a consistent copy of its data (every SQLite file with VACUUM INTO, so the write-ahead log is part of it) together with the owner's access state, verifies the copy, publishes it atomically with restricted permissions and starts the add-on again if it was meant to run. A backup that cannot be completed leaves nothing behind. Repeating the operationId returns the same backup. 503 insufficient_storage means the free space did not fit the backup and nothing was changed. No MCP tool maps to this route.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Back up the data of an add-on (administrators, browser session)", "parameters": [ { "type": "string", "description": "Add-on ID", "name": "id", "in": "path", "required": true }, { "description": "Operation", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/addons.RecoveryBackupRequest" } } ], "responses": { "200": { "description": "The verified backup", "schema": { "$ref": "#/definitions/recovery.BackupReceipt" } }, "400": { "description": "Malformed request", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature, administration or browser session denied", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "404": { "description": "Type not_installed", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "409": { "description": "Type busy", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Unavailable, insufficient_storage, or outcome_unknown (with operationId)", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/{id}/recovery/delete-backup": { "post": { "description": "Administrators only, from their own browser session. The only verified copy and the recovery copy of an upgrade are never removed this way (409 sole_recovery_copy); a purge with explicit scope removes them. No MCP tool maps to this route.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Delete one backup of an add-on (administrators, browser session)", "parameters": [ { "type": "string", "description": "Add-on ID", "name": "id", "in": "path", "required": true }, { "description": "Operation and backup", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/addons.RecoveryDeleteBackupRequest" } } ], "responses": { "200": { "description": "The deleted backup", "schema": { "$ref": "#/definitions/addons.RecoveryDeleted" } }, "400": { "description": "Malformed request", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature, administration or browser session denied", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "404": { "description": "Type backup_not_found", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "409": { "description": "Type sole_recovery_copy or busy", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Unavailable, or outcome_unknown (with operationId)", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/{id}/recovery/prune": { "post": { "description": "Administrators only, from their own browser session. Removes the backups the configured count and age policy no longer keeps. The newest verified backup and the recovery copy of an upgrade stay, whatever their age. No MCP tool maps to this route.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Apply the backup retention policy now (administrators, browser session)", "parameters": [ { "type": "string", "description": "Add-on ID", "name": "id", "in": "path", "required": true }, { "description": "Operation", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/addons.RecoveryPruneRequest" } } ], "responses": { "200": { "description": "The removed backups", "schema": { "$ref": "#/definitions/addons.RecoveryPruned" } }, "400": { "description": "Malformed request", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature, administration or browser session denied", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "409": { "description": "Type busy", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Unavailable, or outcome_unknown (with operationId)", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/{id}/recovery/restore": { "post": { "description": "Administrators only, from their own browser session, with the add-on ID typed as confirm. The add-on must not be running. The backup is verified before anything changes, its files are staged and swapped in atomically, and the data they replace stays as a recovery copy until it is purged. Access is not restored as it was: every grant is checked again against the current accounts and the lowerings of access recorded since the backup, so nobody gets back access that was taken away; pending proposals are cancelled and operations with an unknown outcome are looked up by receipt and never applied again. The answer carries warnings: the time the data goes back to, the number of changes made after it that are lost, and the shares that were not restored. A backup made in local-owner mode needs mapping {\"local-owner\": \"\u003caccount id\u003e\"}; a backup of named-user data is refused in local-owner mode. Repeating the operationId returns the same receipt and does not restore again. No MCP tool maps to this route. The backup must belong to the add-on in the path; a backup of another add-on is refused with type invalid_request and nothing is touched.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Restore a backup of an add-on (administrators, browser session)", "parameters": [ { "type": "string", "description": "Add-on ID", "name": "id", "in": "path", "required": true }, { "description": "Operation, backup, mapping and confirmation", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/addons.RecoveryRestoreRequest" } } ], "responses": { "200": { "description": "What was restored, with warnings", "schema": { "$ref": "#/definitions/recovery.RestoreReceipt" } }, "400": { "description": "Malformed request, type confirmation_mismatch or mapping_invalid", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature, administration or browser session denied", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "404": { "description": "Type backup_not_found", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "409": { "description": "Type addon_running, backup_corrupt, incompatible_format, identity_changed, mapping_required, downgrade_unsupported, operation_conflict or busy", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Unavailable, or outcome_unknown (with operationId)", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/{id}/recovery/verify": { "post": { "description": "Administrators only, from their own browser session. Reads every file of the backup against its manifest digests and runs the SQLite integrity check, and records the result shown in the list. A failed backup stays in place; removing it is a separate explicit action. No MCP tool maps to this route.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Verify a backup of an add-on (administrators, browser session)", "parameters": [ { "type": "string", "description": "Add-on ID", "name": "id", "in": "path", "required": true }, { "description": "Operation and backup", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/addons.RecoveryVerifyRequest" } } ], "responses": { "200": { "description": "The verified backup", "schema": { "$ref": "#/definitions/recovery.BackupReceipt" } }, "400": { "description": "Malformed request", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature, administration or browser session denied", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "404": { "description": "Type backup_not_found", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "409": { "description": "Type backup_corrupt", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Unavailable, or outcome_unknown (with operationId)", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/{id}/update": { "get": { "description": "Returns the owner's update check for an installed add-on, for every authenticated caller who holds the addons feature and may see the add-on (an administrator any installed add-on, others only an enabled one; anything else is the same 403). The status is computed by the owner from the library the add-on was installed from and never from the browser: state is unknown, up-to-date, update-available, incompatible (with reasons: platform, host-version, api-version, protocol-version, sdk-version or data-format), check-failed (with a redacted error class and the time the library was last read) or integrity-error. A failed check is never up-to-date. A moving channel (development, a branch, latest) compares resolved digests, so a changed digest with the same version label is an update; an immutable version selects only a greater compatible version of the same major. The library and channel never change by themselves. The route never uses the network and never applies anything. Callers who are not administrators get the state, versions and times only, without library, channel or digests. No MCP tool maps to this route.", "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Read the update status of an addon", "parameters": [ { "type": "string", "description": "Add-on ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "Update status", "schema": { "$ref": "#/definitions/updates.Status" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature denied, or the add-on is unknown or hidden", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons or the owner are unavailable", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/{id}/update/check": { "post": { "description": "Administrators only, from their own browser session (same-origin fetch, X-LocalAI-Confirm equal to the operationId). The owner fetches the library the add-on was installed from again, through the credential reference the library is configured with, and answers with the new update status. It is rate limited per add-on and per library: within the interval the last status is returned with throttled true. It applies nothing; an upgrade is a separate explicit request. No MCP tool maps to this route.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Check an addon for updates now (administrators, browser session)", "parameters": [ { "type": "string", "description": "Add-on ID", "name": "id", "in": "path", "required": true }, { "description": "Operation", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/addons.UpdateCheckRequest" } } ], "responses": { "200": { "description": "Update status", "schema": { "$ref": "#/definitions/updates.Status" } }, "400": { "description": "Malformed request", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature, administration or browser session denied", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Addons or the owner are unavailable", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/addons/{id}/upgrade": { "post": { "description": "Administrators only, from their own browser session (same-origin fetch, X-LocalAI-Confirm equal to the operationId). The only action that applies an update. It carries the digest of the installed package the caller saw (expectedDigest) and the digest of the candidate the check resolved (candidateDigest). The owner re-resolves the library the add-on came from and refuses, before it records anything, an installed package that is not the expected one (409 stale_installed), a candidate that is not the one it resolves now (409 candidate_changed), an incompatible candidate (409 incompatible), a rewritten immutable version (409 integrity_error) and the same transition under another operation ID (409 upgrade_conflict). It never changes the library or the channel. The upgrade then follows the lifecycle of an add-on: the candidate is staged and verified, the data is backed up and migrated when the add-on has any, and the new generation is published only when it starts. A failure or cancellation keeps the last good generation or leaves an explicit recovery state; the previous installation is never deleted. Repeating the operationId returns the recorded result and never runs again; after outcome_unknown read operation-status with the same operationId. No MCP tool maps to this route.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Addons" ], "summary": "Upgrade an addon to the candidate that was checked (administrators, browser session)", "parameters": [ { "type": "string", "description": "Add-on ID", "name": "id", "in": "path", "required": true }, { "description": "Operation and the pinned digests", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/addons.UpgradeRequest" } } ], "responses": { "200": { "description": "Operation accepted; the payload is the operation status", "schema": { "$ref": "#/definitions/contract.Result" } }, "400": { "description": "Malformed request", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "401": { "description": "Named authentication required", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "403": { "description": "Feature, administration or browser session denied", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "409": { "description": "Type stale_installed, candidate_changed, incompatible, integrity_error, upgrade_conflict, upgrade_failed or operation_conflict", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } }, "503": { "description": "Unavailable, check_failed, or outcome_unknown (with operationId)", "schema": { "$ref": "#/definitions/addons.AddonErrorResponse" } } } } }, "/api/agent/jobs": { "get": { "description": "Newest first. With all_users=true an administrator also gets the jobs of the other users, read-only, in user_groups keyed by owner.", "produces": [ "application/json" ], "tags": [ "agent-jobs" ], "summary": "List agent jobs.", "parameters": [ { "type": "string", "description": "Filter by task ID", "name": "task_id", "in": "query" }, { "type": "string", "description": "Filter by status (pending, running, completed, failed, cancelled)", "name": "status", "in": "query" }, { "type": "integer", "description": "Max number of jobs to return", "name": "limit", "in": "query" }, { "type": "string", "description": "Set to 'true' for the administrator's cross-user listing", "name": "all_users", "in": "query" } ], "responses": { "200": { "description": "jobs", "schema": { "type": "array", "items": { "$ref": "#/definitions/schema.Job" } } } } } }, "/api/agent/jobs/execute": { "post": { "description": "Starts a job for the task as a background chat of the caller and answers at once; poll the job for its status and result. parameters fill the prompt template. images, videos, audios and files are base64 data URIs (an address is not fetched).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "agent-jobs" ], "summary": "Execute an agent job.", "parameters": [ { "description": "Job execution request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.JobExecutionRequest" } } ], "responses": { "201": { "description": "job", "schema": { "$ref": "#/definitions/schema.JobExecutionResponse" } }, "400": { "description": "error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/agent/jobs/{id}": { "get": { "description": "status is pending, running, completed, failed or cancelled; result is the last answer of the chat; traces are the reasoning and tool results. An administrator can read any user's job.", "produces": [ "application/json" ], "tags": [ "agent-jobs" ], "summary": "Get an agent job.", "parameters": [ { "type": "string", "description": "Job ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "job", "schema": { "$ref": "#/definitions/schema.Job" } }, "404": { "description": "error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "delete": { "description": "A running job is stopped first.", "produces": [ "application/json" ], "tags": [ "agent-jobs" ], "summary": "Delete an agent job.", "parameters": [ { "type": "string", "description": "Job ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "message", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/agent/jobs/{id}/cancel": { "post": { "produces": [ "application/json" ], "tags": [ "agent-jobs" ], "summary": "Cancel an agent job.", "parameters": [ { "type": "string", "description": "Job ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "message", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "409": { "description": "error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/agent/jobs/{id}/rerun": { "post": { "description": "Starts a new job with the same task and parameters. Attachments are not kept, so they are not sent again.", "produces": [ "application/json" ], "tags": [ "agent-jobs" ], "summary": "Run an agent job again.", "parameters": [ { "type": "string", "description": "Job ID", "name": "id", "in": "path", "required": true } ], "responses": { "201": { "description": "job", "schema": { "$ref": "#/definitions/schema.JobExecutionResponse" } }, "404": { "description": "error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/agent/tasks": { "get": { "description": "With all_users=true an administrator also gets the tasks of the other users, read-only, in user_groups keyed by owner.", "produces": [ "application/json" ], "tags": [ "agent-jobs" ], "summary": "List agent tasks.", "parameters": [ { "type": "string", "description": "Set to 'true' for the administrator's cross-user listing", "name": "all_users", "in": "query" } ], "responses": { "200": { "description": "tasks", "schema": { "type": "array", "items": { "$ref": "#/definitions/schema.Task" } } } } }, "post": { "description": "A task is a prompt template (Go template syntax, each parameter written as .name between double curly braces) run by a model, or by a saved agent (agent_id), as a background chat. webhooks are called when a job of the task ends; header values are never returned. cron, cron_parameters and multimedia_sources are refused: schedule a saved agent with a trigger. Needs the mcp_jobs feature.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "agent-jobs" ], "summary": "Create an agent task.", "parameters": [ { "description": "Task definition", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.Task" } } ], "responses": { "201": { "description": "id", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/agent/tasks/{id}": { "get": { "produces": [ "application/json" ], "tags": [ "agent-jobs" ], "summary": "Get an agent task.", "parameters": [ { "type": "string", "description": "Task ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "task", "schema": { "$ref": "#/definitions/schema.Task" } }, "404": { "description": "error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "put": { "description": "Replaces every field. A webhook header sent back as \"[hidden]\" keeps its stored value.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "agent-jobs" ], "summary": "Update an agent task.", "parameters": [ { "type": "string", "description": "Task ID", "name": "id", "in": "path", "required": true }, { "description": "Updated task definition", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.Task" } } ], "responses": { "200": { "description": "message", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "delete": { "description": "The jobs of the task stay until their retention passes.", "produces": [ "application/json" ], "tags": [ "agent-jobs" ], "summary": "Delete an agent task.", "parameters": [ { "type": "string", "description": "Task ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "message", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/agent/tasks/{name}/execute": { "post": { "description": "The body is an object of parameters for the prompt template.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "agent-jobs" ], "summary": "Execute an agent task by name.", "parameters": [ { "type": "string", "description": "Task name", "name": "name", "in": "path", "required": true }, { "description": "Optional template parameters", "name": "parameters", "in": "body", "schema": { "type": "object" } } ], "responses": { "201": { "description": "job", "schema": { "$ref": "#/definitions/schema.JobExecutionResponse" } }, "404": { "description": "error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/aliases": { "get": { "tags": [ "models" ], "summary": "List model aliases", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/localai.AliasInfo" } } } } } }, "/api/backend-logs": { "get": { "description": "Returns a sorted list of model IDs that have captured backend process output", "produces": [ "application/json" ], "tags": [ "monitoring" ], "summary": "List models with backend logs", "responses": { "200": { "description": "Model IDs with logs", "schema": { "type": "array", "items": { "type": "string" } } } } } }, "/api/backend-logs/{modelId}": { "get": { "description": "Returns all captured log lines (stdout/stderr) for the specified model's backend process", "produces": [ "application/json" ], "tags": [ "monitoring" ], "summary": "Get backend logs for a model", "parameters": [ { "type": "string", "description": "Model ID", "name": "modelId", "in": "path", "required": true } ], "responses": { "200": { "description": "Log lines", "schema": { "type": "array", "items": { "$ref": "#/definitions/model.BackendLogLine" } } } } } }, "/api/backend-logs/{modelId}/clear": { "post": { "description": "Removes all captured log lines for the specified model's backend process", "tags": [ "monitoring" ], "summary": "Clear backend logs for a model", "parameters": [ { "type": "string", "description": "Model ID", "name": "modelId", "in": "path", "required": true } ], "responses": { "204": { "description": "Logs cleared" } } } }, "/api/backend-traces": { "get": { "description": "Returns a bounded, newest-first page of captured backend traces (LLM calls, embeddings, TTS, etc). The heavy body and data fields are omitted unless full=true; fetch them per-trace from /api/backend-traces/{id}. Paging metadata is returned in the X-Total-Count, X-Trace-Offset and X-Trace-Limit headers.", "produces": [ "application/json" ], "tags": [ "monitoring" ], "summary": "List backend operation traces", "parameters": [ { "type": "integer", "description": "Maximum entries to return (default 50, max 1000, 0 for all)", "name": "limit", "in": "query" }, { "type": "integer", "description": "Number of entries to skip (default 0)", "name": "offset", "in": "query" }, { "type": "boolean", "description": "Include the body and data payloads (default false)", "name": "full", "in": "query" } ], "responses": { "200": { "description": "Backend operation traces", "schema": { "type": "object", "additionalProperties": true } } } } }, "/api/backend-traces/clear": { "post": { "description": "Removes all captured backend operation traces from the buffer", "tags": [ "monitoring" ], "summary": "Clear backend traces", "responses": { "204": { "description": "Traces cleared" } } } }, "/api/backend-traces/{id}": { "get": { "description": "Returns a single captured backend trace, including the body and data payloads omitted from the list response", "produces": [ "application/json" ], "tags": [ "monitoring" ], "summary": "Get one backend operation trace", "parameters": [ { "type": "string", "description": "Trace ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "Backend operation trace", "schema": { "type": "object", "additionalProperties": true } }, "404": { "description": "Trace not found", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/branding": { "get": { "description": "Returns the configured instance name, tagline, and asset URLs. Public — no authentication required.", "produces": [ "application/json" ], "tags": [ "branding" ], "summary": "Get instance branding", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/localai.BrandingResponse" } } } } }, "/api/branding/asset/{kind}": { "post": { "description": "Upload a custom logo, horizontal logo, or favicon. The file replaces any previous override for that kind.", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "branding" ], "summary": "Upload a branding asset", "parameters": [ { "type": "string", "description": "Asset kind: logo, logo_horizontal, or favicon", "name": "kind", "in": "path", "required": true }, { "type": "file", "description": "Image file (png, jpeg, svg, webp, ico — up to 5MiB)", "name": "file", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/localai.BrandingResponse" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "delete": { "description": "Remove a custom branding asset; the UI falls back to the bundled LocalAI default.", "produces": [ "application/json" ], "tags": [ "branding" ], "summary": "Reset a branding asset to default", "parameters": [ { "type": "string", "description": "Asset kind: logo, logo_horizontal, or favicon", "name": "kind", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/localai.BrandingResponse" } } } } }, "/api/chats": { "get": { "tags": [ "chats" ], "summary": "List chats.", "parameters": [ { "type": "integer", "description": "most conversations to return (default 50, at most 200)", "name": "limit", "in": "query" }, { "type": "string", "description": "with chat, sub-agent runs are left out and the limit counts chats", "name": "kind", "in": "query" } ], "responses": { "200": { "description": "Conversations, including sub-agent runs unless kind=chat", "schema": { "$ref": "#/definitions/schema.ChatsConversationList" } } } }, "post": { "description": "With switches, the chat starts with those tools, add-ons and skills switched off (and those opt-in tools on), as GET /api/chats/draft/tools and GET /api/chats/skills list them for a chat that does not exist yet. A bad switch refuses the request and no chat is created.", "tags": [ "chats" ], "summary": "Start a chat.", "parameters": [ { "description": "model and optional title, agent and switches", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsCreateRequest" } } ], "responses": { "201": { "description": "The new conversation", "schema": { "$ref": "#/definitions/schema.ChatsConversation" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "403": { "description": "Refused", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/admin/agents": { "get": { "description": "Read-only view with the owner of each agent. The instructions are not returned.", "tags": [ "chats" ], "summary": "List the saved agents of every user (administrators).", "responses": { "200": { "description": "Every user's agents, by owner and name", "schema": { "$ref": "#/definitions/schema.ChatsAdminAgentList" } }, "403": { "description": "Not an administrator", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/admin/agents/{id}": { "delete": { "tags": [ "chats" ], "summary": "Delete a saved agent of any user (administrators).", "parameters": [ { "type": "string", "description": "Agent ID", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "Deleted" }, "404": { "description": "No such agent", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/admin/connectors": { "get": { "description": "Read-only view with the owner of each binding. The bot token is never returned.", "tags": [ "chats" ], "summary": "List the connector bindings of every user (administrators).", "responses": { "200": { "description": "Every user's bindings, by name", "schema": { "$ref": "#/definitions/schema.ChatsAdminConnectorList" } }, "403": { "description": "Not an administrator", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/admin/connectors/{id}": { "delete": { "tags": [ "chats" ], "summary": "Delete a connector binding of any user (administrators).", "parameters": [ { "type": "string", "description": "Binding ID", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "Deleted" }, "404": { "description": "No such binding", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/admin/connectors/{id}/disable": { "post": { "tags": [ "chats" ], "summary": "Switch off a connector binding of any user (administrators).", "parameters": [ { "type": "string", "description": "Binding ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The binding, now off", "schema": { "$ref": "#/definitions/schema.ChatsConnector" } }, "404": { "description": "No such binding", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/admin/egress": { "get": { "description": "The chats_egress_* settings in force (ceiling, default, allow_private, ports, extra_registries, allowed_hosts, audit_days), the package registries with the extra hosts, the add-on that runs commands and how (isolated or host; the settings do not apply to commands on this machine), and the allowed and blocked requests of the last 24 hours. Change the settings with POST /api/settings.", "tags": [ "chats" ], "summary": "Read the settings of the Sandbox network (administrators).", "responses": { "200": { "description": "The settings in force", "schema": { "$ref": "#/definitions/schema.ChatsEgressAdmin" } } } } }, "/api/chats/admin/egress/events": { "get": { "description": "Every request a command made through the Sandbox proxy, newest first: who, which chat, host, port, kind (connect or http), verdict (allow, block, or done when an allowed connection ended, with its address, bytes and duration) and reason.", "tags": [ "chats" ], "summary": "Read the audit of the Sandbox network requests (administrators).", "parameters": [ { "type": "integer", "description": "How many lines (default 100, at most 500)", "name": "limit", "in": "query" }, { "type": "string", "description": "Only this user", "name": "user", "in": "query" }, { "type": "string", "description": "Only this chat", "name": "chat", "in": "query" }, { "type": "string", "description": "allow, block or done", "name": "verdict", "in": "query" }, { "type": "string", "description": "Only this host", "name": "host", "in": "query" } ], "responses": { "200": { "description": "The newest lines first", "schema": { "$ref": "#/definitions/schema.ChatsEgressEventList" } } } } }, "/api/chats/admin/host-exec/events": { "get": { "description": "Every command the chats' built-in bash ran directly on this machine: who, in which chat, the command (cut at 4 KiB), the exit code (-1 when it did not exit by itself), how long it took and whether it timed out. The commands had the network of the server, so this is also the record of what they could reach.", "tags": [ "chats" ], "summary": "Read the audit of the commands run on this machine (administrators).", "parameters": [ { "type": "integer", "description": "How many lines, newest first (default 100, at most 500)", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "The newest commands first", "schema": { "$ref": "#/definitions/schema.ChatsHostExecEventList" } } } } }, "/api/chats/admin/shared-folders": { "get": { "description": "A member is a user, or @everyone for every user, with the mode read or write.", "tags": [ "chats" ], "summary": "List the shared folders and their members (administrators).", "responses": { "200": { "description": "The shared folders, by name", "schema": { "$ref": "#/definitions/schema.SharedFolderList" } }, "403": { "description": "Not an administrator", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "409": { "description": "Files are off on this server", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "post": { "description": "Creates /shared/\u003cname\u003e with an empty pages folder. You become a member who can edit it, so you can fill it; remove yourself when you do not need it.", "tags": [ "chats" ], "summary": "Create a shared folder (administrators).", "parameters": [ { "description": "The folder's name", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.SharedFolderNameRequest" } } ], "responses": { "201": { "description": "The new folder", "schema": { "$ref": "#/definitions/schema.SharedFolder" } }, "400": { "description": "A name that is not allowed", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "409": { "description": "The name is taken, or the limit is reached", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/admin/shared-folders/events": { "get": { "tags": [ "chats" ], "summary": "Read the audit of the shared folders (administrators).", "parameters": [ { "type": "integer", "description": "How many lines, newest first (default 100, at most 500)", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "The newest changes first", "schema": { "$ref": "#/definitions/schema.SharedFolderEventList" } } } } }, "/api/chats/admin/shared-folders/restore": { "post": { "tags": [ "chats" ], "summary": "Restore a removed shared folder (administrators).", "parameters": [ { "description": "The undo_rev of the removal", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.SharedFolderRestoreRequest" } } ], "responses": { "200": { "description": "The restored folder", "schema": { "$ref": "#/definitions/schema.SharedFolder" } }, "400": { "description": "That change is not the removal of a shared folder", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "409": { "description": "A folder with its name exists now", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/admin/shared-folders/{id}": { "get": { "tags": [ "chats" ], "summary": "Read a shared folder and its members (administrators).", "parameters": [ { "type": "integer", "description": "Shared folder ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The folder", "schema": { "$ref": "#/definitions/schema.SharedFolder" } }, "404": { "description": "No such folder", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "delete": { "description": "Nothing is erased: the folder and its files go to the trash as one change, and undo_rev restores them with their members. Every user's consent to the folder's pages is dropped, so a restored page asks again.", "tags": [ "chats" ], "summary": "Remove a shared folder (administrators).", "parameters": [ { "type": "integer", "description": "Shared folder ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The removed folder and the change to undo", "schema": { "$ref": "#/definitions/schema.SharedFolderRemoved" } }, "404": { "description": "No such folder", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "patch": { "description": "The members, the pages and the consents to them stay. A chat that is open sees the new name the next time it opens.", "tags": [ "chats" ], "summary": "Rename a shared folder (administrators).", "parameters": [ { "type": "integer", "description": "Shared folder ID", "name": "id", "in": "path", "required": true }, { "description": "The new name", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.SharedFolderNameRequest" } } ], "responses": { "200": { "description": "The renamed folder", "schema": { "$ref": "#/definitions/schema.SharedFolder" } }, "404": { "description": "No such folder", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "409": { "description": "The name is taken", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/admin/shared-folders/{id}/members/{principal}": { "put": { "description": "principal is a user's ID, email or name, or @everyone for every user, the ones who sign up later too. mode is read or write.", "tags": [ "chats" ], "summary": "Add a member to a shared folder or change their mode (administrators).", "parameters": [ { "type": "integer", "description": "Shared folder ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "User ID, email or name, or @everyone", "name": "principal", "in": "path", "required": true }, { "description": "The mode", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.SharedFolderMemberRequest" } } ], "responses": { "200": { "description": "The folder and its members", "schema": { "$ref": "#/definitions/schema.SharedFolder" } }, "400": { "description": "No such user, or a mode that is not read or write", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "No such folder", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "delete": { "description": "The member's pages list and chats stop showing the folder. A member who is not there is not an error.", "tags": [ "chats" ], "summary": "Remove a member from a shared folder (administrators).", "parameters": [ { "type": "integer", "description": "Shared folder ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "User ID, email or name, or @everyone", "name": "principal", "in": "path", "required": true } ], "responses": { "200": { "description": "The folder and its members", "schema": { "$ref": "#/definitions/schema.SharedFolder" } }, "404": { "description": "No such folder", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/admin/tools": { "get": { "description": "The built-in tools of the chats (bash, web_search, web_fetch, as this server registers them): label, the per-chat switch group, the runtime setting that switches each off and the ones that configure it, whether it is on, whether it only reads and whether an add-on may replace it, who serves it now (builtin, an add-on's ID, or empty), the add-ons that replace it (oldest install first, with their install times in installed_at), the default one that serves with no pin (default: the oldest running install) and the one pinned with chats_tool_providers, the titles of the candidates, the candidates that are installed but stopped (stopped), a note \"not running\" when an installed add-on replaces the tool but none serves, and for bash the mode of chats_host_exec and why this server cannot run it, if so. skills lists the built-in skills (xlsx, docx, pptx, pdf) that an installed add-on replaces: who serves each now, the add-ons that replace it (the same order, default and installed_at) and the one pinned in the same chats_tool_providers map. Change them with POST /api/settings.", "tags": [ "chats" ], "summary": "List the built-in chat tools (administrators).", "responses": { "200": { "description": "The built-in tools, by ID", "schema": { "$ref": "#/definitions/schema.ChatsBuiltinToolList" } } } } }, "/api/chats/admin/triggers": { "get": { "description": "Read-only view with the owner of each trigger and its last run.", "tags": [ "chats" ], "summary": "List the triggers of every user (administrators).", "responses": { "200": { "description": "Every user's triggers, by owner and name", "schema": { "$ref": "#/definitions/schema.ChatsAdminTriggerList" } }, "403": { "description": "Not an administrator", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/admin/triggers/{id}": { "delete": { "tags": [ "chats" ], "summary": "Delete a trigger of any user (administrators).", "parameters": [ { "type": "string", "description": "Trigger ID", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "Deleted" }, "404": { "description": "No such trigger", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/admin/triggers/{id}/disable": { "post": { "tags": [ "chats" ], "summary": "Switch off a trigger of any user (administrators).", "parameters": [ { "type": "string", "description": "Trigger ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The trigger, now off", "schema": { "$ref": "#/definitions/schema.ChatsAdminTrigger" } }, "404": { "description": "No such trigger", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/admin/triggers/{id}/runs": { "get": { "tags": [ "chats" ], "summary": "List the runs of a trigger of any user (administrators).", "parameters": [ { "type": "string", "description": "Trigger ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "How many runs, newest first (default 20, at most 200)", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "The runs, newest first", "schema": { "$ref": "#/definitions/schema.ChatsTriggerRunList" } }, "404": { "description": "No such trigger", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/admin/web/test": { "post": { "description": "Runs the query with each search provider of the built-in web_search tool, in the order of chats_web_search_providers (by default DuckDuckGo, Brave Search and Bing without a key, or the SearXNG instance of chats_web_searxng_url), and returns what each did (ok, no_results, challenged, blocked, timeout or error), the first three results of the first answer, or the error a user would read. Save the settings first. The test counts as one search against the rate limits.", "tags": [ "chats" ], "summary": "Run a test web search with the saved settings (administrators).", "parameters": [ { "description": "the query (default LocalAI)", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsWebTestRequest" } } ], "responses": { "200": { "description": "The provider and its results, or the error", "schema": { "$ref": "#/definitions/schema.ChatsWebTestResponse" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "403": { "description": "Not an administrator", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "503": { "description": "The built-in web tools are not available on this instance", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/agents": { "get": { "tags": [ "chats" ], "summary": "List your saved agents.", "responses": { "200": { "description": "Your agents, sorted by name", "schema": { "$ref": "#/definitions/schema.ChatsAgentList" } } } }, "post": { "description": "An agent is a definition: instructions and exact lists of the MCP servers, add-ons, collections and skills a chat with it may use. A chat gets what the lists name and you may use at that moment, never more. Start a chat with it by passing agent_id to POST /api/chats.", "tags": [ "chats" ], "summary": "Save an agent.", "parameters": [ { "description": "the agent", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsAgentWrite" } } ], "responses": { "201": { "description": "The saved agent", "schema": { "$ref": "#/definitions/schema.ChatsAgent" } } } } }, "/api/chats/agents/import": { "post": { "description": "Send the export file as the JSON body, or as the file field of a multipart form. A bare agent definition (the body of POST /api/chats/agents) is accepted too. The agent is always new: a name you already use gets a number, and a model this server does not have, or you may not use, is dropped with a warning.", "consumes": [ "application/json", "multipart/form-data" ], "tags": [ "chats" ], "summary": "Import a saved agent.", "parameters": [ { "description": "the agent file", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsAgentExport" } }, { "type": "file", "description": "the agent file (multipart)", "name": "file", "in": "formData" } ], "responses": { "201": { "description": "The new agent and what the import changed", "schema": { "$ref": "#/definitions/schema.ChatsAgentImportResult" } } } } }, "/api/chats/agents/templates": { "get": { "description": "Ready-made definitions to start from. They grant nothing; save one, then grant it tools. POST /api/chats/agents/templates/{id}/create saves one for you.", "tags": [ "chats" ], "summary": "List the starter agents.", "responses": { "200": { "description": "The starter agents", "schema": { "$ref": "#/definitions/schema.ChatsAgentTemplateList" } } } } }, "/api/chats/agents/templates/{id}/create": { "post": { "tags": [ "chats" ], "summary": "Save a starter agent as your own.", "parameters": [ { "type": "string", "description": "the template's id", "name": "id", "in": "path", "required": true }, { "description": "a name to use instead of the template's", "name": "request", "in": "body", "schema": { "$ref": "#/definitions/schema.ChatsAgentTemplateUse" } } ], "responses": { "201": { "description": "The saved agent", "schema": { "$ref": "#/definitions/schema.ChatsAgent" } } } } }, "/api/chats/agents/{id}": { "get": { "tags": [ "chats" ], "summary": "Read a saved agent.", "parameters": [ { "type": "string", "description": "the agent's id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The agent", "schema": { "$ref": "#/definitions/schema.ChatsAgent" } }, "404": { "description": "No such conversation, or it is another user's", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "put": { "description": "The body replaces every field. Chats that already run with the agent use the new definition from their next turn.", "tags": [ "chats" ], "summary": "Replace a saved agent.", "parameters": [ { "type": "string", "description": "the agent's id", "name": "id", "in": "path", "required": true }, { "description": "the agent", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsAgentWrite" } } ], "responses": { "200": { "description": "The saved agent", "schema": { "$ref": "#/definitions/schema.ChatsAgent" } }, "404": { "description": "No such conversation, or it is another user's", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "delete": { "description": "Chats that ran with it keep their history; their next turn runs without the agent's tools.", "tags": [ "chats" ], "summary": "Delete a saved agent.", "parameters": [ { "type": "string", "description": "the agent's id", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "Deleted" }, "404": { "description": "No such conversation, or it is another user's", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/agents/{id}/export": { "get": { "description": "Returns the definition as a JSON file (version, kind localai-agent, agent). It holds no ID, owner or time. POST /api/chats/agents/import reads it. This replaces the old /api/agents/{name}/export.", "tags": [ "chats" ], "summary": "Export a saved agent.", "parameters": [ { "type": "string", "description": "the agent's id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The agent file", "schema": { "$ref": "#/definitions/schema.ChatsAgentExport" } } } } }, "/api/chats/agents/{id}/runs": { "get": { "description": "Lists your chats that ran with the agent, newest first: the ones you had, the ones its triggers started and the ones its connectors started, with how each ended. Open one with GET /api/chats/{chat_id}.", "tags": [ "chats" ], "summary": "Show what an agent has run.", "parameters": [ { "type": "string", "description": "the agent's id", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "most runs to list (default 50, at most 200)", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "The runs and the counts", "schema": { "$ref": "#/definitions/schema.ChatsAgentHistory" } } } } }, "/api/chats/connectors": { "get": { "description": "A binding connects a bot of a messaging platform (served by a connector add-on, such as Telegram) to one of your saved agents. A person who messages the bot talks to that agent, in a conversation of their own, as you: your quota, your model allowlist and only the agent's grants apply.", "tags": [ "chats" ], "summary": "List your connector bindings.", "responses": { "200": { "description": "Your bindings, sorted by name", "schema": { "$ref": "#/definitions/schema.ChatsConnectorList" } } } }, "post": { "description": "Needs the kind (the platform), the bot token (kept sealed, never returned) and an agent of yours that names a model. The token is checked with the platform when its add-on runs: a token that the platform refuses is a 400. reply_mode (off, progress, stream; default progress), conversation (sender, chat, window with window_minutes, thread; default sender) and send_files (default true) say how the bot answers. The allowlist is empty at first, so nobody is accepted: add chat IDs, user IDs or @usernames, or set accept_any (anyone who can message the bot then uses the agent's tools; the request that turns it on must also carry confirm_accept_any set to \"accept any message\", or it is a 400). At most 10 bindings.", "tags": [ "chats" ], "summary": "Create a connector binding.", "parameters": [ { "description": "the binding", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsConnectorWrite" } } ], "responses": { "201": { "description": "The binding", "schema": { "$ref": "#/definitions/schema.ChatsConnector" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/connectors/kinds": { "get": { "description": "The messaging platforms that a running connector add-on serves, with the add-on page that adds and edits their bindings. Empty when no connector add-on is installed.", "tags": [ "chats" ], "summary": "List the connector kinds you can bind.", "responses": { "200": { "description": "The kinds", "schema": { "$ref": "#/definitions/schema.ChatsConnectorKindList" } } } } }, "/api/chats/connectors/{id}": { "get": { "tags": [ "chats" ], "summary": "Read a connector binding.", "parameters": [ { "type": "string", "description": "the binding's id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The binding", "schema": { "$ref": "#/definitions/schema.ChatsConnector" } } } }, "put": { "description": "The body replaces every field except the token, which is kept unless the request has a new one, and send_files, which is kept when it is absent. A new token is checked with the platform: a token that the platform refuses is a 400 and nothing is saved.", "tags": [ "chats" ], "summary": "Replace a connector binding.", "parameters": [ { "type": "string", "description": "the binding's id", "name": "id", "in": "path", "required": true }, { "description": "the binding", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsConnectorWrite" } } ], "responses": { "200": { "description": "The binding", "schema": { "$ref": "#/definitions/schema.ChatsConnector" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "delete": { "description": "Its offset, sender log and sender-to-chat map go; the chats it made stay.", "tags": [ "chats" ], "summary": "Delete a connector binding.", "parameters": [ { "type": "string", "description": "the binding's id", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "Deleted" } } } }, "/api/chats/connectors/{id}/disable": { "post": { "tags": [ "chats" ], "summary": "Switch a connector binding off.", "parameters": [ { "type": "string", "description": "the binding's id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The binding", "schema": { "$ref": "#/definitions/schema.ChatsConnector" } } } } }, "/api/chats/connectors/{id}/enable": { "post": { "tags": [ "chats" ], "summary": "Switch a connector binding on.", "parameters": [ { "type": "string", "description": "the binding's id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The binding", "schema": { "$ref": "#/definitions/schema.ChatsConnector" } } } } }, "/api/chats/connectors/{id}/senders": { "get": { "description": "The log of people who wrote to the bot, newest first, with whether they were accepted. A message from a sender who is not accepted is ignored, never answered.", "tags": [ "chats" ], "summary": "List the senders of a connector binding.", "parameters": [ { "type": "string", "description": "the binding's id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The senders", "schema": { "$ref": "#/definitions/schema.ChatsConnectorSenderList" } } } } }, "/api/chats/connectors/{id}/senders/{sender}/allow": { "post": { "description": "Adds a sender who already wrote to the bot to the allowlist.", "tags": [ "chats" ], "summary": "Allow a sender of a connector binding.", "parameters": [ { "type": "string", "description": "the binding's id", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "the sender's id from the sender log", "name": "sender", "in": "path", "required": true } ], "responses": { "200": { "description": "The binding", "schema": { "$ref": "#/definitions/schema.ChatsConnector" } } } } }, "/api/chats/connectors/{id}/test": { "post": { "description": "Asks the platform, through its add-on, for the bot of the stored token. 502 when the platform refuses the token, the add-on does not run or the platform cannot be reached.", "tags": [ "chats" ], "summary": "Test a connector binding.", "parameters": [ { "type": "string", "description": "the binding's id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The bot", "schema": { "$ref": "#/definitions/schema.ChatsConnectorTest" } } } } }, "/api/chats/conversion": { "get": { "description": "At start the server converts the old chat page, agents, tasks, skills and Telegram connectors into chats, saved agents, triggers, skills and connector bindings. Triggers and connectors are made switched off. This lists the items that belong to you, with what was dropped and why; an administrator also gets the totals of all users. It never holds a token or the text of a prompt.", "tags": [ "chats" ], "summary": "Report the conversion of your old agents, skills and chats.", "responses": { "200": { "description": "The report", "schema": { "$ref": "#/definitions/schema.ChatsConversion" } } } } }, "/api/chats/draft/addons": { "get": { "description": "What GET /api/chats/{id}/addons lists, for a chat that does not exist yet, as GET /api/chats/draft/tools takes it: the add-ons with their default switch and whether the chat could run commands at its first turn.", "tags": [ "chats" ], "summary": "List the add-ons a new chat could use.", "parameters": [ { "type": "string", "description": "the model of the new chat", "name": "model", "in": "query" }, { "type": "string", "description": "a saved agent of yours", "name": "agent_id", "in": "query" } ], "responses": { "200": { "description": "The add-ons and their default switches", "schema": { "$ref": "#/definitions/schema.ChatsAddonList" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "403": { "description": "Refused", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "No such agent", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/draft/tools": { "get": { "description": "What GET /api/chats/{id}/tools lists, for a chat that does not exist yet: a chat on model, with the saved agent agent_id when it is set (the agent's model, when it has one, replaces model). Every switch is in its default state. The composer of a new chat shows it and sends the person's choices in the switches of POST /api/chats.", "tags": [ "chats" ], "summary": "List the tools a new chat could switch on and off.", "parameters": [ { "type": "string", "description": "the model of the new chat", "name": "model", "in": "query" }, { "type": "string", "description": "a saved agent of yours", "name": "agent_id", "in": "query" } ], "responses": { "200": { "description": "The tools and their default switches", "schema": { "$ref": "#/definitions/schema.ChatsToolsPanel" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "403": { "description": "Refused", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "No such agent", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/files": { "get": { "tags": [ "chats" ], "summary": "List a folder of your files.", "parameters": [ { "type": "string", "description": "folder inside your home; default /", "name": "path", "in": "query" } ], "responses": { "200": { "description": "The folder's entries, sorted by name, each with when it last changed; managed marks the folders LocalAI manages; max_file_size is the largest upload the server takes", "schema": { "$ref": "#/definitions/schema.ChatsFileList" } }, "409": { "description": "Files are off on this server", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "delete": { "description": "Nothing is erased: the deletion is a change that the Trash lists and undo restores.", "tags": [ "chats" ], "summary": "Delete a file or folder.", "parameters": [ { "type": "string", "description": "file or folder inside your home", "name": "path", "in": "query", "required": true } ], "responses": { "200": { "description": "deleted", "schema": { "type": "object", "additionalProperties": { "type": "boolean" } } } } } }, "/api/chats/files/content": { "get": { "description": "Files are served as downloads. With inline=1 an image, PDF, plain text, audio or video is shown by the browser instead. Ranges are supported.", "produces": [ "application/octet-stream" ], "tags": [ "chats" ], "summary": "Download a file.", "parameters": [ { "type": "string", "description": "file inside your home", "name": "path", "in": "query", "required": true }, { "type": "integer", "description": "1 to show a safe type in the browser", "name": "inline", "in": "query" } ], "responses": { "200": { "description": "The file", "schema": { "type": "file" } } } }, "put": { "description": "The request body is the file. A file that exists is replaced only when the upload says which version it started from (base); otherwise both are kept and the new one gets a conflict name, reported in conflict_of. overwrite=1 replaces without the check.", "consumes": [ "application/octet-stream" ], "tags": [ "chats" ], "summary": "Upload a file.", "parameters": [ { "type": "string", "description": "file inside your home; missing folders are created", "name": "path", "in": "query", "required": true }, { "type": "integer", "description": "version of the existing file the upload started from", "name": "base", "in": "query" }, { "type": "integer", "description": "1 to replace without the version check", "name": "overwrite", "in": "query" } ], "responses": { "200": { "description": "The stored file", "schema": { "$ref": "#/definitions/schema.ChatsFile" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "413": { "description": "The file is too large", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/files/folders": { "post": { "tags": [ "chats" ], "summary": "Create a folder.", "parameters": [ { "description": "the folder", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsFolderRequest" } } ], "responses": { "200": { "description": "The folder", "schema": { "$ref": "#/definitions/schema.ChatsFile" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/files/history": { "get": { "tags": [ "chats" ], "summary": "List the changes to your files.", "parameters": [ { "type": "string", "description": "folder or file inside your home; default /", "name": "path", "in": "query" }, { "type": "integer", "description": "most entries to return (default 50, at most 200)", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "Change sets, newest first", "schema": { "$ref": "#/definitions/schema.ChatsHistory" } } } } }, "/api/chats/files/move": { "post": { "tags": [ "chats" ], "summary": "Move or rename a file or folder.", "parameters": [ { "description": "from and to", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsMoveRequest" } } ], "responses": { "200": { "description": "The moved entry", "schema": { "$ref": "#/definitions/schema.ChatsFile" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/files/preview": { "get": { "description": "Reads the values of a .xlsx, .xlsm, .csv or .tsv file (kind \"table\": every sheet, at most the first 200 rows and 30 columns, with the size of the whole sheet), the headings and paragraphs of a .docx (kind \"document\") or the slide titles, text and speaker notes of a .pptx (kind \"slides\"). The formatting is not kept. The same path rules as the download apply. Files over 20 MiB are not read.", "produces": [ "application/json" ], "tags": [ "chats" ], "summary": "Preview a spreadsheet, document or presentation.", "parameters": [ { "type": "string", "description": "file inside your home", "name": "path", "in": "query", "required": true } ], "responses": { "200": { "description": "The content of the file", "schema": { "$ref": "#/definitions/schema.ChatsFilePreview" } }, "400": { "description": "The path is not valid or is a folder", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "No such file", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "413": { "description": "The file is over 20 MiB", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "415": { "description": "This type of file has no preview", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "422": { "description": "The file could not be read", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/files/search": { "get": { "description": "Finds files by name, lines inside text files and lines of the text of PDF, Word, Excel and PowerPoint files that contain the query, ignoring case. Only what you can read is searched. A document hit has document true and its page, sheet or slide; indexing counts the documents whose text is still being read. Text files over 1 MiB and other binary files are found by name only.", "tags": [ "chats" ], "summary": "Search your files.", "parameters": [ { "type": "string", "description": "text to find", "name": "q", "in": "query", "required": true }, { "type": "string", "description": "search only below this folder; default /", "name": "path", "in": "query" }, { "type": "integer", "description": "most hits to return (default 50, at most 200)", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "Name matches first, then lines", "schema": { "$ref": "#/definitions/schema.ChatsSearchResult" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/files/trash": { "get": { "tags": [ "chats" ], "summary": "List the Trash.", "responses": { "200": { "description": "Deletions that nobody has undone, newest first", "schema": { "$ref": "#/definitions/schema.ChatsTrash" } } } }, "delete": { "description": "Permanently deletes every file and folder in your Trash, with their older versions, and frees the space. It cannot be undone. It touches only your own Trash. The agent tools cannot do this; it is an action of the person.", "tags": [ "chats" ], "summary": "Empty the Trash.", "responses": { "200": { "description": "What was removed", "schema": { "$ref": "#/definitions/schema.ChatsTrashTotals" } } } } }, "/api/chats/files/trash/{rev}": { "delete": { "description": "Permanently deletes the files and folders that one change set deleted, by the revision that the Trash lists. It cannot be undone. A revision that is not in your Trash is 404.", "tags": [ "chats" ], "summary": "Delete one item of the Trash permanently.", "parameters": [ { "type": "integer", "description": "revision of the Trash entry", "name": "rev", "in": "path", "required": true } ], "responses": { "200": { "description": "What was removed", "schema": { "$ref": "#/definitions/schema.ChatsTrashTotals" } }, "400": { "description": "The revision is not a number", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "Not in your Trash", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/files/undo": { "post": { "description": "Restores what a change set changed, as a new change. When later changes conflict, nothing changes and the answer is 409, unless skip_conflicts is set: then the rest is restored and the conflicts are listed.", "tags": [ "chats" ], "summary": "Undo a change.", "parameters": [ { "description": "the revision", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsUndoRequest" } } ], "responses": { "200": { "description": "The new revision and any conflicts that were skipped", "schema": { "$ref": "#/definitions/schema.ChatsUndoResponse" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "409": { "description": "The state of the server does not allow it (a feature that is off, or a conflict)", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/import": { "post": { "description": "Creates a new chat from a JSON export. The model of the file is used unless the request names another; it must be one you may use. The chat has no files and no tool state; the next message starts it.", "tags": [ "chats" ], "summary": "Import an exported chat.", "parameters": [ { "description": "the export and an optional model", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsImportRequest" } } ], "responses": { "201": { "description": "The new chat", "schema": { "$ref": "#/definitions/schema.ChatsConversation" } }, "400": { "description": "The body is not a valid export", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "413": { "description": "The export is too large", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/import/browser": { "post": { "description": "Send the value of the browser's localStorage key \"localai_chats_data\" as it is: {\"chats\": [...]}. Each chat with a creation date and a message becomes one of your chats, with its transcript. A chat that you have already, with the same title and creation time, is skipped, so the upload can be repeated. The import changes nothing in the browser; the page clears its copy when the answer says nothing failed.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "chats" ], "summary": "Import the chats that the old chat page kept in your browser.", "parameters": [ { "description": "the stored value, {chats: [...]}", "name": "request", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "What was imported", "schema": { "$ref": "#/definitions/schema.ChatsBrowserImport" } }, "400": { "description": "The body is not the stored form", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/mcp-connectors": { "get": { "description": "An MCP connector is an MCP server that you defined. Your chats use the enabled ones next to the MCP servers of the model, and a saved agent can name one as connector:\u003cid\u003e. Tokens, headers and the environment of a local command are never returned. Needs the MCP feature.", "tags": [ "chats" ], "summary": "List your MCP connectors.", "responses": { "200": { "description": "Your connectors, sorted by name", "schema": { "$ref": "#/definitions/schema.ChatsMCPConnectorList" } } } }, "post": { "description": "transport is http (a remote server, streamable HTTP with a fall back to SSE) or stdio (a command run on the host, administrators only and refused in distributed mode). The address of an http connector must be http or https; an address on a private network is refused unless an administrator allows it (the mcp_connectors_allow_private setting), and the check is made again when the connection is opened. token, headers and env are sealed at rest and never returned. At most 20 connectors; names are unique per user. OAuth for remote servers is not supported.", "tags": [ "chats" ], "summary": "Create an MCP connector.", "parameters": [ { "description": "the connector", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsMCPConnectorWrite" } } ], "responses": { "201": { "description": "The connector", "schema": { "$ref": "#/definitions/schema.ChatsMCPConnector" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/mcp-connectors/{id}": { "get": { "tags": [ "chats" ], "summary": "Read an MCP connector.", "parameters": [ { "type": "string", "description": "the connector's id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The connector", "schema": { "$ref": "#/definitions/schema.ChatsMCPConnector" } } } }, "put": { "description": "The body replaces every field. token, headers and env keep the stored value when left out, and are cleared by an empty one. The open session of the connector is closed.", "tags": [ "chats" ], "summary": "Replace an MCP connector.", "parameters": [ { "type": "string", "description": "the connector's id", "name": "id", "in": "path", "required": true }, { "description": "the connector", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsMCPConnectorWrite" } } ], "responses": { "200": { "description": "The connector", "schema": { "$ref": "#/definitions/schema.ChatsMCPConnector" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "delete": { "description": "Its open session is closed. A saved agent that names it gets a note that it could not be used.", "tags": [ "chats" ], "summary": "Delete an MCP connector.", "parameters": [ { "type": "string", "description": "the connector's id", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "Deleted" } } } }, "/api/chats/mcp-connectors/{id}/disable": { "post": { "tags": [ "chats" ], "summary": "Switch an MCP connector off.", "parameters": [ { "type": "string", "description": "the connector's id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The connector", "schema": { "$ref": "#/definitions/schema.ChatsMCPConnector" } } } } }, "/api/chats/mcp-connectors/{id}/enable": { "post": { "description": "The address is checked again; one on a private network is refused unless an administrator allows it.", "tags": [ "chats" ], "summary": "Switch an MCP connector on.", "parameters": [ { "type": "string", "description": "the connector's id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The connector", "schema": { "$ref": "#/definitions/schema.ChatsMCPConnector" } } } } }, "/api/chats/mcp-connectors/{id}/test": { "post": { "description": "Connects with the stored definition, with the same address and credential checks as a chat, and lists the tools, with the description each one has in tool_details. It works for a connector that is switched off. A server that cannot be used is a 200 with ok false and the reason, which never holds a header value.", "tags": [ "chats" ], "summary": "Test an MCP connector.", "parameters": [ { "type": "string", "description": "the connector's id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The tools, or the reason", "schema": { "$ref": "#/definitions/schema.ChatsMCPConnectorTest" } } } } }, "/api/chats/notifications": { "get": { "description": "The inbox: one item for each run of a trigger that finished, failed or needs you. Newest first. It also returns the number unread and the total kept.", "tags": [ "chats" ], "summary": "List your notifications.", "parameters": [ { "type": "boolean", "description": "only the unread ones", "name": "unread", "in": "query" }, { "type": "integer", "description": "most items to return (default 50, at most 500)", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "The notifications", "schema": { "$ref": "#/definitions/schema.ChatsNotificationList" } } } }, "delete": { "description": "Name the ids, or pass all to empty your inbox; with all, read_only keeps the unread ones. Only your own notifications are touched.", "tags": [ "chats" ], "summary": "Delete notifications.", "parameters": [ { "description": "ids, or all", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsNotificationsDelete" } } ], "responses": { "200": { "description": "The number still unread and how many were deleted", "schema": { "$ref": "#/definitions/schema.ChatsNotificationCount" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/notifications/count": { "get": { "tags": [ "chats" ], "summary": "Count unread notifications.", "responses": { "200": { "description": "The number unread", "schema": { "$ref": "#/definitions/schema.ChatsNotificationCount" } } } } }, "/api/chats/notifications/events": { "get": { "description": "Server-sent events: one notification event for each new inbox item, with the same fields as the list, and a notifications_changed event when notifications were read or deleted, so a client reads the list again. Live only; list the inbox for what came before.", "produces": [ "text/event-stream" ], "tags": [ "chats" ], "summary": "Stream your notifications.", "responses": { "200": { "description": "An event stream", "schema": { "$ref": "#/definitions/schema.ChatsNotification" } } } } }, "/api/chats/notifications/read": { "post": { "description": "Name the ids, or pass all. Opening a chat marks its notifications read by itself.", "tags": [ "chats" ], "summary": "Mark notifications read.", "parameters": [ { "description": "ids or all", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsNotificationsRead" } } ], "responses": { "200": { "description": "The number still unread", "schema": { "$ref": "#/definitions/schema.ChatsNotificationCount" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/page-starters": { "get": { "tags": [ "pages" ], "summary": "List the starter pages that ship with the server.", "responses": { "200": { "description": "The starters", "schema": { "$ref": "#/definitions/schema.PagesStarterList" } } } } }, "/api/chats/page-starters/{id}/copy": { "post": { "description": "The copy is named after the starter, or the starter's name with -2, -3 and so on when that is taken. It is yours to change.", "tags": [ "pages" ], "summary": "Copy a starter page into pages/.", "parameters": [ { "type": "string", "description": "starter id", "name": "id", "in": "path", "required": true } ], "responses": { "201": { "description": "The new page", "schema": { "$ref": "#/definitions/schema.PagesPage" } }, "404": { "description": "No such starter", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/pages": { "get": { "description": "A page is a folder pages/\u003cname\u003e/ of your home with an index.html. Folders without one are left out.", "tags": [ "pages" ], "summary": "List your pages.", "responses": { "200": { "description": "Your pages, sorted by name", "schema": { "$ref": "#/definitions/schema.PagesList" } }, "403": { "description": "The pages feature is off for your account", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "409": { "description": "Files are off on this server", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/pages/{name}": { "get": { "description": "The UI shows the HTML in a sandboxed frame. An index.html over 1 MiB is refused.", "tags": [ "pages" ], "summary": "Read a page and its index.html.", "parameters": [ { "type": "string", "description": "page name", "name": "name", "in": "path", "required": true } ], "responses": { "200": { "description": "The page and its HTML", "schema": { "$ref": "#/definitions/schema.PagesSource" } }, "404": { "description": "No such page", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "413": { "description": "index.html is larger than 1 MiB", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/pages/{name}/chat": { "post": { "description": "The UI calls this after the person saw the message and chose Send. The message is added to the chat as a user message that says which page it comes from, so it shows in the chat before the assistant answers. Without chat_id it goes to the page's own chat, created on first use with model (or the model of your most recent chat). Rate limited per page.", "tags": [ "pages" ], "summary": "Send a message from a page to a chat (bridge chat.send).", "parameters": [ { "type": "string", "description": "page name", "name": "name", "in": "path", "required": true }, { "description": "the message", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.PagesChatRequest" } } ], "responses": { "200": { "description": "Where the message went", "schema": { "$ref": "#/definitions/schema.PagesChatResponse" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "No such page or chat", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "429": { "description": "Too many messages", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/pages/{name}/file": { "get": { "description": "With encoding=base64 the file must be an image (png, jpg, gif, webp, avif, bmp, ico or svg, by extension) and content is its bytes in base64. The UI uses it to put the images next to a page into the page as data: URLs; the bridge of a page reads text only.", "tags": [ "pages" ], "summary": "Read a text file of a page (bridge files.read).", "parameters": [ { "type": "string", "description": "page name", "name": "name", "in": "path", "required": true }, { "type": "string", "description": "file inside the page's folder, for example data.json", "name": "path", "in": "query", "required": true }, { "type": "string", "description": "base64 to read an image", "name": "encoding", "in": "query" } ], "responses": { "200": { "description": "The file and its text", "schema": { "$ref": "#/definitions/schema.PagesFileContent" } }, "400": { "description": "The path leaves the page's folder", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "413": { "description": "The file is larger than 1 MiB", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "415": { "description": "The file is not UTF-8 text, or not an image with encoding=base64", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "put": { "description": "Missing folders are created. A page writes data files only: code and document files (.js .mjs .cjs .css .html .htm .svg .xml .xhtml .wasm, index, page.json) are refused with 403; the Files page and file tools are not affected. With base, a file that changed since is kept and the content goes to a conflict copy (conflict_of). Writes are rate limited per page.", "tags": [ "pages" ], "summary": "Write a text file of a page (bridge files.write).", "parameters": [ { "type": "string", "description": "page name", "name": "name", "in": "path", "required": true }, { "description": "the file", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.PagesWriteRequest" } } ], "responses": { "200": { "description": "The stored file", "schema": { "$ref": "#/definitions/schema.PagesFile" } }, "400": { "description": "The path leaves the page's folder", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "403": { "description": "The page tried to change its own code", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "413": { "description": "The file is larger than 1 MiB", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "429": { "description": "Too many writes", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/pages/{name}/files": { "get": { "tags": [ "pages" ], "summary": "List a folder of a page (bridge files.list).", "parameters": [ { "type": "string", "description": "page name", "name": "name", "in": "path", "required": true }, { "type": "string", "description": "folder inside the page's folder; default the page's folder", "name": "dir", "in": "query" } ], "responses": { "200": { "description": "The entries, with paths relative to the page's folder", "schema": { "$ref": "#/definitions/schema.PagesFileList" } }, "400": { "description": "The path leaves the page's folder", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/push/key": { "get": { "description": "The VAPID public key a browser needs to subscribe to push for your notifications. 409 when the server cannot keep subscriptions (no database and no data path).", "tags": [ "chats" ], "summary": "Get the browser push key.", "responses": { "200": { "description": "The key", "schema": { "$ref": "#/definitions/schema.ChatsPushKey" } } } } }, "/api/chats/push/subscribe": { "post": { "description": "Pass the endpoint and keys of a browser PushSubscription. A notification is then pushed to that browser with its title and link only. The endpoint must be an https address on the public internet. At most 10 browsers per user; the oldest go first.", "tags": [ "chats" ], "summary": "Subscribe a browser to push.", "parameters": [ { "description": "the browser's subscription", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsPushSubscription" } } ], "responses": { "204": { "description": "Subscribed" }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "delete": { "tags": [ "chats" ], "summary": "Unsubscribe a browser from push.", "parameters": [ { "description": "the endpoint", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsPushUnsubscribe" } } ], "responses": { "204": { "description": "Unsubscribed" }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/search": { "get": { "description": "Finds chats whose title or messages contain the text, ignoring case. The newest chats come first. It reads the newest 500 chats.", "tags": [ "chats" ], "summary": "Search your chats.", "parameters": [ { "type": "string", "description": "text to find", "name": "q", "in": "query", "required": true }, { "type": "integer", "description": "most chats to return (default 50, at most 200)", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "The matching chats", "schema": { "$ref": "#/definitions/schema.ChatsChatSearchResponse" } } } } }, "/api/chats/shared-folders": { "get": { "description": "A shared folder is a folder outside your home that an administrator gave you, or every user, access to. mode is read or write. pages counts its pages (pages/\u003cname\u003e/index.html); open them from /api/chats/shared-pages. Your chats see each folder at /workspace/shared-\u003cname\u003e.", "tags": [ "chats" ], "summary": "List the folders shared with you.", "responses": { "200": { "description": "Your shared folders, by path", "schema": { "$ref": "#/definitions/schema.SharedFolderList" } }, "409": { "description": "Files are off on this server", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/shared-folders/{id}": { "get": { "tags": [ "chats" ], "summary": "Read a folder shared with you.", "parameters": [ { "type": "integer", "description": "Shared folder ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The folder and your mode", "schema": { "$ref": "#/definitions/schema.SharedFolder" } }, "404": { "description": "No such folder, or it is not shared with you", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/shared-pages": { "get": { "description": "A shared folder is a folder outside your home that an administrator gave you access to. Its pages are the folders pages/\u003cname\u003e/ with an index.html. Each page has its folder, its author (the account that last wrote index.html), the hash of its code and your consent: none, allowed (this version) or changed (you allowed an earlier one). enabled is false when an administrator turned shared pages off.", "tags": [ "pages" ], "summary": "List the pages of your shared folders.", "responses": { "200": { "description": "The pages, by folder and name", "schema": { "$ref": "#/definitions/schema.PagesSharedList" } }, "403": { "description": "The pages feature is off for your account", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/shared-pages/{folder}/{name}": { "get": { "description": "The UI shows the trust sheet unless the consent is allowed, and runs the HTML only after you allow its hash. consent has the size and lines of the version you allowed, so a changed page can say what changed.", "tags": [ "pages" ], "summary": "Read a shared page, its index.html and your consent.", "parameters": [ { "type": "integer", "description": "shared folder id (folder_id of the list)", "name": "folder", "in": "path", "required": true }, { "type": "string", "description": "page name", "name": "name", "in": "path", "required": true } ], "responses": { "200": { "description": "The page, its HTML and your consent", "schema": { "$ref": "#/definitions/schema.PagesSharedSource" } }, "403": { "description": "Shared pages are off on this server", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "No such page, or no access to its folder", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/shared-pages/{folder}/{name}/chat": { "post": { "description": "As for an own page: the UI calls it after you saw the message and chose Send, and the message says which shared page it comes from.", "tags": [ "pages" ], "summary": "Send a message from a shared page to a chat (bridge chat.send).", "parameters": [ { "type": "integer", "description": "shared folder id", "name": "folder", "in": "path", "required": true }, { "type": "string", "description": "page name", "name": "name", "in": "path", "required": true }, { "description": "the message", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.PagesChatRequest" } } ], "responses": { "200": { "description": "Where the message went", "schema": { "$ref": "#/definitions/schema.PagesChatResponse" } }, "403": { "description": "You have not allowed this version (page_not_allowed)", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "429": { "description": "Too many messages", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/shared-pages/{folder}/{name}/consent": { "put": { "description": "hash is the hash you reviewed; a page that changed since is refused with 409. once allows one visit: the answer has a token that the bridge calls of that visit send. Each consent and revoke is audited.", "tags": [ "pages" ], "summary": "Allow a version of a shared page to run.", "parameters": [ { "type": "integer", "description": "shared folder id", "name": "folder", "in": "path", "required": true }, { "type": "string", "description": "page name", "name": "name", "in": "path", "required": true }, { "description": "the version", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.PagesConsentRequest" } } ], "responses": { "200": { "description": "The consent", "schema": { "$ref": "#/definitions/schema.PagesConsentResponse" } }, "409": { "description": "The page changed while you were reviewing it", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "delete": { "description": "Its open frames stop at their next bridge call; the next open shows the trust sheet again.", "tags": [ "pages" ], "summary": "Stop allowing a shared page.", "parameters": [ { "type": "integer", "description": "shared folder id", "name": "folder", "in": "path", "required": true }, { "type": "string", "description": "page name", "name": "name", "in": "path", "required": true } ], "responses": { "204": { "description": "Revoked" } } } }, "/api/chats/shared-pages/{folder}/{name}/file": { "get": { "description": "With encoding=base64 the file must be an image, as for your own pages. A file of the page's code (index.html, page.json and the code_files of the page) is read only by a frame of the current version: an older frame gets 409, so a script changed after the consent never runs under it.", "tags": [ "pages" ], "summary": "Read a text file of a shared page (bridge files.read).", "parameters": [ { "type": "integer", "description": "shared folder id", "name": "folder", "in": "path", "required": true }, { "type": "string", "description": "page name", "name": "name", "in": "path", "required": true }, { "type": "string", "description": "file inside the page's folder", "name": "path", "in": "query", "required": true }, { "type": "string", "description": "base64 to read an image", "name": "encoding", "in": "query" } ], "responses": { "200": { "description": "The file", "schema": { "$ref": "#/definitions/schema.PagesFileContent" } }, "403": { "description": "You have not allowed this version (page_not_allowed)", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "409": { "description": "A file of code changed since the version that runs", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "put": { "description": "With your own grant on the folder: a read grant is refused with 403. A page writes data files only: code and document files (.js .mjs .cjs .css .html .htm .svg .xml .xhtml .wasm, index, page.json) are refused with 403.", "tags": [ "pages" ], "summary": "Write a text file of a shared page (bridge files.write).", "parameters": [ { "type": "integer", "description": "shared folder id", "name": "folder", "in": "path", "required": true }, { "type": "string", "description": "page name", "name": "name", "in": "path", "required": true }, { "description": "the file", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.PagesWriteRequest" } } ], "responses": { "200": { "description": "The stored file", "schema": { "$ref": "#/definitions/schema.PagesFile" } }, "403": { "description": "Not allowed, or you can only read the folder", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/shared-pages/{folder}/{name}/files": { "get": { "description": "Needs the headers X-LocalAI-Page-Hash (the version that runs) and, for a visit allowed once, X-LocalAI-Page-Visit.", "tags": [ "pages" ], "summary": "List a folder of a shared page (bridge files.list).", "parameters": [ { "type": "integer", "description": "shared folder id", "name": "folder", "in": "path", "required": true }, { "type": "string", "description": "page name", "name": "name", "in": "path", "required": true }, { "type": "string", "description": "folder inside the page's folder", "name": "dir", "in": "query" } ], "responses": { "200": { "description": "The entries", "schema": { "$ref": "#/definitions/schema.PagesFileList" } }, "403": { "description": "You have not allowed this version (page_not_allowed)", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/skills": { "get": { "description": "Skills from every layer: .skills folders of your files, your personal skills, the shared ones, the ones of the add-ons you may use now (addon, with the add-on in addon and addon_title) and the built-in ones. The nearest wins; a skill that another overrides says so in shadowed. With chat set, the chat's switches are applied.", "tags": [ "chats" ], "summary": "List your skills.", "parameters": [ { "type": "string", "description": "a chat id, to apply its switches", "name": "chat", "in": "query" } ], "responses": { "200": { "description": "The skills", "schema": { "$ref": "#/definitions/schema.ChatsSkillList" } } } }, "post": { "description": "A skill is a folder with a SKILL.md: a name, a one-line description and the procedure the model reads when a task matches. The personal layer is yours; the shared layer needs an administrator.", "tags": [ "chats" ], "summary": "Create a skill.", "parameters": [ { "description": "the skill", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsSkillWrite" } } ], "responses": { "200": { "description": "The skill", "schema": { "$ref": "#/definitions/schema.ChatsSkillDetail" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/skills/{layer}/{name}": { "get": { "tags": [ "chats" ], "summary": "Read a skill.", "parameters": [ { "type": "string", "description": "personal, shared, addon or builtin", "name": "layer", "in": "path", "required": true }, { "type": "string", "description": "the skill's name", "name": "name", "in": "path", "required": true }, { "type": "string", "description": "the add-on's ID, for the addon layer", "name": "addon", "in": "query" } ], "responses": { "200": { "description": "The skill with its text", "schema": { "$ref": "#/definitions/schema.ChatsSkillDetail" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "put": { "tags": [ "chats" ], "summary": "Change a skill.", "parameters": [ { "type": "string", "description": "personal or shared", "name": "layer", "in": "path", "required": true }, { "type": "string", "description": "the skill's name", "name": "name", "in": "path", "required": true }, { "description": "the new description and body", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsSkillUpdate" } } ], "responses": { "200": { "description": "The skill", "schema": { "$ref": "#/definitions/schema.ChatsSkillDetail" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "delete": { "description": "The skill's folder goes to the Trash of your files, where it can be restored. Shared skills need an administrator.", "tags": [ "chats" ], "summary": "Delete a skill.", "parameters": [ { "type": "string", "description": "personal or shared", "name": "layer", "in": "path", "required": true }, { "type": "string", "description": "the skill's name", "name": "name", "in": "path", "required": true } ], "responses": { "200": { "description": "deleted", "schema": { "type": "object", "additionalProperties": { "type": "boolean" } } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/triggers": { "get": { "description": "A trigger starts a chat as you, by itself, on a schedule or when a file arrives in a folder of your files. Each run is an ordinary chat, marked with its trigger, that you can open and undo.", "tags": [ "chats" ], "summary": "List your triggers.", "responses": { "200": { "description": "Your triggers, sorted by name", "schema": { "$ref": "#/definitions/schema.ChatsTriggerList" } } } }, "post": { "description": "kind is schedule (schedule: \"daily 08:00\", \"weekdays 09:30\", \"weekly mon,thu 09:30\", \"monthly 15 08:00\", \"once 2026-12-24 18:00\" or five cron fields; time_zone: an IANA name) or file (folder: a path inside your files). It runs nothing for the time before it was saved. At most 50 triggers.", "tags": [ "chats" ], "summary": "Create a trigger.", "parameters": [ { "description": "the trigger", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsTriggerWrite" } } ], "responses": { "201": { "description": "The trigger", "schema": { "$ref": "#/definitions/schema.ChatsTrigger" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/triggers/changes/{id}": { "get": { "description": "A model in a chat can ask to edit, pause, resume or delete one of your triggers (update_trigger, delete_trigger). An edit or a delete waits for you; a pause or a resume applies at once. The chat carries the change as a tool card of kind trigger_change whose id is the change's id. The answer is kept on the server, so the card says the same after a reload and on every frontend. 404 once the change is no longer kept (a week after its answer).", "tags": [ "chats" ], "summary": "Read a trigger change and its answer.", "parameters": [ { "type": "string", "description": "the change's id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The change", "schema": { "$ref": "#/definitions/schema.ChatsTriggerChange" } } } }, "delete": { "description": "The trigger stays as it is. The answer is kept, so the card shows it.", "tags": [ "chats" ], "summary": "Dismiss a trigger change.", "parameters": [ { "type": "string", "description": "the change's id", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "Dismissed" } } } }, "/api/chats/triggers/changes/{id}/apply": { "post": { "description": "Makes the edit or deletes the trigger. 409 when the trigger was changed or removed since the change was asked for, or when the change was answered already.", "tags": [ "chats" ], "summary": "Apply a trigger change.", "parameters": [ { "type": "string", "description": "the change's id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The change, now applied", "schema": { "$ref": "#/definitions/schema.ChatsTriggerChange" } }, "409": { "description": "The trigger changed since, or the change was answered", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/triggers/changes/{id}/undo": { "post": { "description": "Puts the trigger back as it was before the change, for a day after it applied: an edit, a pause or a resume is reverted, and a deleted trigger is restored with its id (its run history is not). 409 when the time is over, the trigger was changed since (the message says so), or you have as many triggers as you may.", "tags": [ "chats" ], "summary": "Undo a trigger change.", "parameters": [ { "type": "string", "description": "the change's id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The change, now undone", "schema": { "$ref": "#/definitions/schema.ChatsTriggerChange" } }, "409": { "description": "The change cannot be undone", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/triggers/preview": { "get": { "description": "Returns the next times a schedule text runs in a time zone, and the schedule in plain words. A bad text is a 400 with the reason.", "tags": [ "chats" ], "summary": "Preview a schedule.", "parameters": [ { "type": "string", "description": "the schedule text", "name": "when", "in": "query", "required": true }, { "type": "string", "description": "an IANA time zone name (default UTC)", "name": "tz", "in": "query" }, { "type": "integer", "description": "how many times (default 3, at most 10)", "name": "n", "in": "query" } ], "responses": { "200": { "description": "The next times", "schema": { "$ref": "#/definitions/schema.ChatsTriggerPreview" } } } } }, "/api/chats/triggers/proposals": { "get": { "description": "A model in a chat can propose a trigger. A proposal is not active and runs nothing; confirm it to turn it into a trigger that is on. The chat shows it as a tool line with a card of kind trigger_proposal whose id is the proposal's id, and a trigger_proposed event announces it.", "tags": [ "chats" ], "summary": "List trigger proposals.", "parameters": [ { "type": "string", "description": "only the proposals made in this chat", "name": "chat", "in": "query" } ], "responses": { "200": { "description": "The proposals", "schema": { "$ref": "#/definitions/schema.ChatsTriggerList" } } } } }, "/api/chats/triggers/proposals/{id}": { "get": { "description": "Answers the state of a proposal the chat made: pending, accepted (the trigger is the one that accepting made, with the same id), declined or undone. The answer is kept on the server, so the chat shows the same receipt after a reload and on every frontend. 404 once the trigger was removed on the Triggers page.", "tags": [ "chats" ], "summary": "Read a trigger proposal and its answer.", "parameters": [ { "type": "string", "description": "the proposal's id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The proposal", "schema": { "$ref": "#/definitions/schema.ChatsTriggerProposal" } } } }, "put": { "description": "The body replaces every field of the proposal, as for a trigger. The proposal stays a proposal: it is not active until you confirm it.", "tags": [ "chats" ], "summary": "Edit a trigger proposal.", "parameters": [ { "type": "string", "description": "the proposal's id", "name": "id", "in": "path", "required": true }, { "description": "the new fields", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsTriggerWrite" } } ], "responses": { "200": { "description": "The proposal", "schema": { "$ref": "#/definitions/schema.ChatsTrigger" } } } }, "delete": { "description": "The proposal stays as a declined record (GET .../proposals/{id}) that .../reopen restores.", "tags": [ "chats" ], "summary": "Dismiss a trigger proposal.", "parameters": [ { "type": "string", "description": "the proposal's id", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "Dismissed" } } } }, "/api/chats/triggers/proposals/{id}/confirm": { "post": { "description": "Turns the proposal into a trigger that is on. time_zone is used when the proposal names none.", "tags": [ "chats" ], "summary": "Confirm a trigger proposal.", "parameters": [ { "type": "string", "description": "the proposal's id", "name": "id", "in": "path", "required": true }, { "description": "the time zone of the person confirming", "name": "request", "in": "body", "schema": { "$ref": "#/definitions/schema.ChatsTriggerConfirm" } } ], "responses": { "200": { "description": "The trigger", "schema": { "$ref": "#/definitions/schema.ChatsTrigger" } } } } }, "/api/chats/triggers/proposals/{id}/reopen": { "post": { "tags": [ "chats" ], "summary": "Restore a declined or undone trigger proposal.", "parameters": [ { "type": "string", "description": "the proposal's id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The proposal, waiting again", "schema": { "$ref": "#/definitions/schema.ChatsTriggerProposal" } } } } }, "/api/chats/triggers/proposals/{id}/undo": { "post": { "description": "Switches the trigger that accepting made off and removes it from the Triggers page; the proposal stays as an undone record that can be reopened. 409 when the trigger already ran or was edited or switched since (the message says so), or when the proposal is not accepted.", "tags": [ "chats" ], "summary": "Undo an accepted trigger proposal.", "parameters": [ { "type": "string", "description": "the proposal's id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The proposal, now undone", "schema": { "$ref": "#/definitions/schema.ChatsTriggerProposal" } } } } }, "/api/chats/triggers/{id}": { "get": { "tags": [ "chats" ], "summary": "Read a trigger.", "parameters": [ { "type": "string", "description": "the trigger's id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The trigger", "schema": { "$ref": "#/definitions/schema.ChatsTrigger" } } } }, "put": { "description": "The body replaces every field. A change of when it runs, or switching it on, means it runs nothing for the time before the change.", "tags": [ "chats" ], "summary": "Replace a trigger.", "parameters": [ { "type": "string", "description": "the trigger's id", "name": "id", "in": "path", "required": true }, { "description": "the trigger", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsTriggerWrite" } } ], "responses": { "200": { "description": "The trigger", "schema": { "$ref": "#/definitions/schema.ChatsTrigger" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "delete": { "description": "Its queued runs are dropped and a running run is stopped. The chats it made stay.", "tags": [ "chats" ], "summary": "Delete a trigger.", "parameters": [ { "type": "string", "description": "the trigger's id", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "Deleted" } } } }, "/api/chats/triggers/{id}/disable": { "post": { "tags": [ "chats" ], "summary": "Switch a trigger off.", "parameters": [ { "type": "string", "description": "the trigger's id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The trigger", "schema": { "$ref": "#/definitions/schema.ChatsTrigger" } } } } }, "/api/chats/triggers/{id}/enable": { "post": { "tags": [ "chats" ], "summary": "Switch a trigger on.", "parameters": [ { "type": "string", "description": "the trigger's id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The trigger", "schema": { "$ref": "#/definitions/schema.ChatsTrigger" } } } } }, "/api/chats/triggers/{id}/run": { "post": { "description": "Starts a run at once, whether the trigger is on or not. The run is skipped, with its reason, when the trigger has a run going. On a cluster the run may start a few seconds later.", "tags": [ "chats" ], "summary": "Run a trigger now.", "parameters": [ { "type": "string", "description": "the trigger's id", "name": "id", "in": "path", "required": true } ], "responses": { "202": { "description": "The run", "schema": { "$ref": "#/definitions/schema.ChatsTriggerRun" } } } } }, "/api/chats/triggers/{id}/runs": { "get": { "tags": [ "chats" ], "summary": "List the runs of a trigger.", "parameters": [ { "type": "string", "description": "the trigger's id", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "most runs to return (default 20, at most 200)", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "Newest first", "schema": { "$ref": "#/definitions/schema.ChatsTriggerRunList" } } } } }, "/api/chats/wellknown/{name}": { "get": { "description": "name is persona, user, shortcuts, home, ui or widget-data. The file is validated against its JSON Schema. When it is not valid, data holds its last valid version from the history and errors says what is wrong. A missing file is an empty object with exists false. widget-data needs path, the data file of a Home widget.", "tags": [ "chats" ], "summary": "Read a well-known file of your home.", "parameters": [ { "type": "string", "description": "persona, user, shortcuts, home, ui or widget-data", "name": "name", "in": "path", "required": true }, { "type": "string", "description": "the data file, for widget-data", "name": "path", "in": "query" } ], "responses": { "200": { "description": "The file; the ETag header holds its version", "schema": { "$ref": "#/definitions/schema.ChatsWellKnownFile" } }, "404": { "description": "Not a well-known file", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "409": { "description": "Files are off on this server", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "put": { "description": "The keys of values replace the keys of the file and a null removes one; keys the request does not name stay as they are. With replace, values is the whole file. The result must match the JSON Schema of the file and be at most 64 KiB. Send the version you read in If-Match (0 when the file did not exist): when the file changed since, the answer is 409 with what it holds now. Without If-Match the write is not checked.", "tags": [ "chats" ], "summary": "Change a well-known file of your home.", "parameters": [ { "type": "string", "description": "persona, user, shortcuts, home, ui or widget-data", "name": "name", "in": "path", "required": true }, { "type": "string", "description": "the data file, for widget-data", "name": "path", "in": "query" }, { "type": "string", "description": "the version you read", "name": "If-Match", "in": "header" }, { "description": "the keys to change", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsWellKnownWrite" } } ], "responses": { "200": { "description": "The file as written", "schema": { "$ref": "#/definitions/schema.ChatsWellKnownFile" } }, "400": { "description": "The result does not match the schema; errors lists why", "schema": { "$ref": "#/definitions/schema.ChatsWellKnownError" } }, "409": { "description": "The file changed since you read it; current holds it", "schema": { "$ref": "#/definitions/schema.ChatsWellKnownError" } }, "413": { "description": "The file would be larger than 64 KiB", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/wellknown/{name}/revert": { "post": { "description": "Without a body, writes the newest earlier version that differs from the file and matches its schema. With {\"rev\"}, writes that version from GET .../versions. Either way it is a new change: the revert itself can be undone, and the newer version stays in the list.", "tags": [ "chats" ], "summary": "Revert a well-known file to an earlier valid version.", "parameters": [ { "type": "string", "description": "persona, user, shortcuts, home, ui or widget-data", "name": "name", "in": "path", "required": true }, { "type": "string", "description": "the data file, for widget-data", "name": "path", "in": "query" }, { "description": "the version to write back", "name": "request", "in": "body", "schema": { "$ref": "#/definitions/schema.ChatsWellKnownRevert" } } ], "responses": { "200": { "description": "The file as written", "schema": { "$ref": "#/definitions/schema.ChatsWellKnownFile" } }, "409": { "description": "There is no such valid version", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/wellknown/{name}/schema": { "get": { "description": "The same schema is in the built-in skill localai-workspace, which the assistant reads. Properties may carry x-ui hints for the settings pages (widget, hidden).", "produces": [ "application/schema+json" ], "tags": [ "chats" ], "summary": "Get the JSON Schema of a well-known file.", "parameters": [ { "type": "string", "description": "persona, user, shortcuts, home, ui or widget-data", "name": "name", "in": "path", "required": true } ], "responses": { "200": { "description": "A JSON Schema, draft 2020-12", "schema": { "type": "object", "additionalProperties": true } }, "404": { "description": "Not a well-known file", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/wellknown/{name}/versions": { "get": { "description": "Newest first, from the history of your files: when, who (kind user or agent, and the chat that wrote it), and the content when it matches the schema. POST .../revert {rev} writes one back.", "tags": [ "chats" ], "summary": "List the versions of a well-known file.", "parameters": [ { "type": "string", "description": "persona, user, shortcuts, home, ui or widget-data", "name": "name", "in": "path", "required": true }, { "type": "string", "description": "the data file, for widget-data", "name": "path", "in": "query" }, { "type": "integer", "description": "most versions to return (default 10, at most 50)", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "The versions, newest first", "schema": { "$ref": "#/definitions/schema.ChatsWellKnownVersions" } }, "404": { "description": "Not a well-known file", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/{id}": { "get": { "tags": [ "chats" ], "summary": "Get a chat.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The conversation and its pending messages", "schema": { "$ref": "#/definitions/schema.ChatsConversationDetail" } }, "404": { "description": "No such conversation, or it is another user's", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "delete": { "tags": [ "chats" ], "summary": "Delete a chat.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "deleted", "schema": { "type": "object", "additionalProperties": { "type": "boolean" } } }, "404": { "description": "No such conversation, or it is another user's", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "patch": { "description": "The settings (system prompt, temperature, top_p, top_k, reasoning effort, context size) are kept with the chat and apply from its next turn. A new title or model needs a chat with no turn running (409 otherwise).", "tags": [ "chats" ], "summary": "Rename a chat, move it to another model or change its settings.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true }, { "description": "the fields to change", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsUpdateRequest" } } ], "responses": { "200": { "description": "The chat after the change", "schema": { "$ref": "#/definitions/schema.ChatsConversation" } } } } }, "/api/chats/{id}/addons": { "get": { "description": "The add-ons whose tools the signed-in user may use now, each with the chat's switch, and whether the chat can run commands at its next turn (commands: available, off, unavailable, none, or switched_off when the chat switched the built-in group shell off). When commands is available, commands_provider says who serves bash (builtin: directly on this machine with no isolation and with its network, or the add-on's ID) and commands_isolation says isolated or host; commands_consent is ask when each command waits for a yes in the chat, and commands_fallback names an add-on that would serve but does not (commands_fallback_reason: off, or why it cannot run). Without the add-on host the list is empty.", "tags": [ "chats" ], "summary": "List the add-ons a chat can use.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The add-ons and their switches", "schema": { "$ref": "#/definitions/schema.ChatsAddonList" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "No such conversation, or it is another user's", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "put": { "description": "The list replaces the earlier one. The next turn of the chat gets the tools of the add-ons that are on.", "tags": [ "chats" ], "summary": "Switch the tools of add-ons on and off for a chat.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true }, { "description": "the IDs of the add-ons that are off", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsAddonSwitches" } } ], "responses": { "200": { "description": "The add-ons and their switches now in force", "schema": { "$ref": "#/definitions/schema.ChatsAddonList" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "No such conversation, or it is another user's", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/{id}/agents": { "get": { "description": "Each sub-agent run is its own conversation. This lists the runs of one chat with their state, from the shared store, so runs started on any frontend show. A chat runs at most background_limit in the background at once. Live starts and ends arrive as sub_agent_started and sub_agent_done events.", "tags": [ "chats" ], "summary": "List the sub-agents of a chat.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The sub-agent runs", "schema": { "$ref": "#/definitions/schema.ChatsSubAgentList" } } } } }, "/api/chats/{id}/agents/{agent_id}/messages": { "get": { "tags": [ "chats" ], "summary": "Read a sub-agent's transcript.", "parameters": [ { "type": "string", "description": "conversation id of the parent", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "sub-agent run id", "name": "agent_id", "in": "path", "required": true }, { "type": "integer", "description": "only lines after this sequence number", "name": "after", "in": "query" }, { "type": "integer", "description": "most lines to return (default 200, at most 1000)", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "Transcript lines in order", "schema": { "$ref": "#/definitions/schema.ChatsMessageList" } } } } }, "/api/chats/{id}/agents/{agent_id}/stop": { "post": { "description": "Ends the run's turn, wherever it runs. The parent goes on and sees a failed sub-agent.", "tags": [ "chats" ], "summary": "Stop a sub-agent.", "parameters": [ { "type": "string", "description": "conversation id of the parent", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "sub-agent run id", "name": "agent_id", "in": "path", "required": true } ], "responses": { "200": { "description": "stopped", "schema": { "type": "object", "additionalProperties": { "type": "boolean" } } } } } }, "/api/chats/{id}/builtins": { "put": { "description": "off replaces the earlier list of groups that are off. The groups are shell (bash, whether the Sandbox add-on or the built-in bash on this machine serves it), web (web_search and web_fetch), files (list_files, read_file, write_file, edit_file, move_file, delete_file, search_files and read_document), media (describe_image and transcribe_audio), collections (list_collections and search_collection), subagents (spawn_agent), triggers (propose_trigger, list_triggers, update_trigger and delete_trigger) and saved_agents. A sub-agent follows the switches of its parent chat. An opt-in group (opt_in in the list, such as saved_agents: list_agents and the agent argument of spawn_agent) is off until on names it; on replaces the earlier list of opt-in groups that are on, and an opt-in group in off is ignored. Omit on to keep it. A switch never adds what the administrator has off or the user may not use. The next turn of the chat gets the tools that are on.", "tags": [ "chats" ], "summary": "Switch groups of built-in tools on and off for a chat.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true }, { "description": "the groups that are off", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsBuiltinSwitches" } } ], "responses": { "200": { "description": "The tools and their switches now in force", "schema": { "$ref": "#/definitions/schema.ChatsToolsPanel" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "No such conversation, or it is another user's", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/{id}/clear": { "post": { "description": "The transcript gets a cleared line, and from the next turn on the model sees nothing before it. The messages stay readable, and the chat keeps its files, title and switches. A branch made from a message above the line keeps what the model saw there. 409 while a turn runs; 400 when there is nothing to clear.", "tags": [ "chats" ], "summary": "Clear a chat's context.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "cleared", "schema": { "type": "object", "additionalProperties": { "type": "boolean" } } }, "400": { "description": "Nothing to clear", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "No such conversation, or it is another user's", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "409": { "description": "A turn is running", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/{id}/compact": { "post": { "description": "The older part of the conversation becomes a summary for the model, the way the chat does by itself when its context fills up; the last messages stay as they are. The transcript keeps every message and gets a compacted line with the sizes, and the next turn starts from the compacted context. It takes a while: the model writes the summary. 409 while a turn runs; 400 when the conversation is too short.", "tags": [ "chats" ], "summary": "Compact a chat's context now.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The size of the context, in tokens, before and after", "schema": { "$ref": "#/definitions/schema.ChatsContextResult" } }, "400": { "description": "The conversation is too short", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "No such conversation, or it is another user's", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "409": { "description": "A turn is running", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/{id}/egress": { "get": { "description": "The preset of the chat (off, registries, all), the administrator's ceiling, the preset in force (the lower of the two), whether it applies (false when commands run on this machine, applies_reason host, or no Sandbox serves bash, none), addon (the add-on that runs the commands and draws the network controls of the chat, from its network-policy host control; absent when none does), the package registries the preset registries admits, the chat's allow and deny rules (above_limit when the ceiling no longer admits one) and the cards that asked. A sub-agent chat shows its parent's. Another user's chat is 404.", "tags": [ "chats" ], "summary": "Read the network of a chat's Sandbox commands.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The network of the chat", "schema": { "$ref": "#/definitions/schema.ChatsEgress" } }, "404": { "description": "No such conversation, or it is another user's", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "put": { "description": "off reaches nothing; registries the HTTPS hosts of the package registries; all every public host. A preset above the administrator's ceiling (chats_egress_ceiling) is 400 egress_above_ceiling. A sub-agent follows its parent: 409. It applies at the next connection of a command.", "tags": [ "chats" ], "summary": "Set the network preset of a chat's Sandbox commands.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true }, { "description": "the preset", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsEgressPreset" } } ], "responses": { "200": { "description": "The network of the chat", "schema": { "$ref": "#/definitions/schema.ChatsEgress" } }, "400": { "description": "Not a preset, or above the ceiling", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "No such conversation, or it is another user's", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/{id}/egress/consent": { "post": { "description": "A command asked for a host the chat does not allow but the administrator's ceiling would: an egress_consent event carried the card id and host:port, and the card is in GET /api/chats/{id}/egress. once allows the host for the rest of that command (or the next call of the chat within ten minutes when the answer comes late), chat stores an allow rule for the chat, deny stores a deny rule so the host does not ask again. A host inside your network (private) needs an administrator to allow it; anyone who owns the chat may deny. A card that expired at the end of its turn may still be answered. The waiting connection goes on at once; without an answer it gets a 403 after 60 seconds.", "tags": [ "chats" ], "summary": "Answer a network card of a chat's Sandbox commands.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true }, { "description": "the card id and the answer", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsEgressConsent" } } ], "responses": { "204": { "description": "The answer was stored and sent to the waiting command" }, "400": { "description": "Not an answer, or the ceiling does not admit the host (egress_above_ceiling; the card is refused, and every later answer gets the same reason)", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "403": { "description": "Only an administrator can allow a host inside your network", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "No such conversation or card", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "409": { "description": "The card was answered already with another answer (already_answered); the same answer again is 204", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/{id}/egress/rules/{host}/{port}": { "delete": { "description": "Removes the rule that allows or denies one host and port for the chat's Sandbox commands. A host that was denied asks again; one that was allowed follows the preset again.", "tags": [ "chats" ], "summary": "Remove a network rule of a chat.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "host name", "name": "host", "in": "path", "required": true }, { "type": "integer", "description": "port", "name": "port", "in": "path", "required": true } ], "responses": { "204": { "description": "Removed" }, "404": { "description": "No such conversation, or no such rule", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/{id}/events": { "get": { "description": "Server-sent events: text, reasoning, tool_start, tool_end, checkpoint, turn_start, turn_end, error, pending_delivered, sub_agent_done, compacted (the context was compacted, by the chat or by POST compact; before and after are token counts), cleared (the context was cleared; read the transcript again), paused (the tool loop reached its step limit, chats_max_iterations; steps is the limit), goal (the chat's goal changed; text is its state, empty when cleared: read the chat again), files and loops (the loops of the chat changed; read GET /api/chats/{id}/loops). Events are live only; read the transcript for what came before.", "produces": [ "text/event-stream" ], "tags": [ "chats" ], "summary": "Stream a chat's events.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "An event stream", "schema": { "$ref": "#/definitions/schema.ChatsEvent" } }, "404": { "description": "No such conversation, or it is another user's", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/{id}/export": { "get": { "description": "Returns the chat as Markdown (format=markdown, the default) or as JSON (format=json), which POST /api/chats/import reads. Files, tool state and checkpoints are not exported.", "produces": [ "text/markdown", "application/json" ], "tags": [ "chats" ], "summary": "Export a chat.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "markdown (default) or json", "name": "format", "in": "query" } ], "responses": { "200": { "description": "The chat (JSON format)", "schema": { "$ref": "#/definitions/schema.ChatsExport" } } } } }, "/api/chats/{id}/files": { "get": { "description": "The files that belong to one conversation: the files in its folder under Chats (attached by the user, or written there), and the files its turns created or changed elsewhere in the user's home folder. Paths are the current ones, so they follow a rename of the chat. Each file has a kind: deliverable, or working for a script, a log or a draft the chat made on the way (in its work folder Chats/\u003cchat\u003e/work, or a helper file elsewhere). The model gets the same list in its prompt at every turn. A files event on the chat's event stream says that the list may have changed.", "tags": [ "chats" ], "summary": "List the files of a chat.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The files of the chat", "schema": { "$ref": "#/definitions/schema.ChatsChatFileList" } } } } }, "/api/chats/{id}/fork": { "post": { "description": "Copies the transcript up to and including the given line into a new chat with the same model, settings and tool switches. The original is not changed.", "tags": [ "chats" ], "summary": "Fork a chat from a message.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true }, { "description": "where to cut and the new title", "name": "request", "in": "body", "schema": { "$ref": "#/definitions/schema.ChatsForkRequest" } } ], "responses": { "201": { "description": "The new chat", "schema": { "$ref": "#/definitions/schema.ChatsConversation" } } } } }, "/api/chats/{id}/goal": { "get": { "tags": [ "chats" ], "summary": "Get a chat's goal.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The goal, or null", "schema": { "$ref": "#/definitions/schema.ChatsGoalResponse" } }, "404": { "description": "No such conversation, or it is another user's", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "put": { "description": "Sets the goal, replacing the one the chat had (replaced). With no turn running a turn starts on it at once. While the goal is active the server starts the next turn by itself when one ends, until the model calls goal_done or goal_blocked, you stop or clear it, or the limits chats_goal_max_turns and chats_goal_max_steps pause it. A chat that a trigger, a connector, a job or a page started, and a sub-agent run, cannot have a goal (409).", "tags": [ "chats" ], "summary": "Set a chat's goal.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true }, { "description": "the goal", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsGoalRequest" } } ], "responses": { "200": { "description": "The new goal and the one it replaced", "schema": { "$ref": "#/definitions/schema.ChatsGoalResponse" } }, "400": { "description": "The text is empty or longer than 2000 characters", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "No such conversation, or it is another user's", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "409": { "description": "This chat cannot have a goal", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "delete": { "description": "A running turn goes on; nothing follows it by itself. Clearing a chat with no goal is not an error.", "tags": [ "chats" ], "summary": "Clear a chat's goal.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "goal null, replaced the goal that was removed", "schema": { "$ref": "#/definitions/schema.ChatsGoalResponse" } }, "404": { "description": "No such conversation, or it is another user's", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/{id}/goal/resume": { "post": { "description": "Makes a paused or blocked goal active again with new turn and step counts, and starts a turn on it when none runs. A reached goal does not resume (409): set a new one.", "tags": [ "chats" ], "summary": "Resume a chat's goal.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The goal", "schema": { "$ref": "#/definitions/schema.ChatsGoalResponse" } }, "404": { "description": "No such conversation, or the chat has no goal", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "409": { "description": "The goal is reached, or this chat cannot have a goal", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/{id}/host-exec/consent": { "post": { "description": "When chats_host_exec is ask, each command of the chat's built-in bash waits for an answer: a host_exec_consent event carries the id and the command. once runs it (administrators only); deny refuses it (anyone who owns the chat). The command runs with no isolation, as the user LocalAI runs as, with the network of the server. Without an answer the call ends after 5 minutes. A card waits only while the turn that asked runs; an answer to one whose turn has ended is 410 consent_expired.", "tags": [ "chats" ], "summary": "Allow or refuse one command of the built-in bash on this machine.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true }, { "description": "the id of the event and the answer", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsHostExecConsent" } } ], "responses": { "204": { "description": "The answer was stored with the card and sent to the running turn" }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "403": { "description": "Only an administrator can allow a command", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "No such conversation, or it is another user's", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "409": { "description": "The card was answered already with the other answer (already_answered); the same answer again is 204", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "410": { "description": "The card expired (consent_expired): the turn that asked has ended, its frontend stopped, or a newer card replaced it; the command did not run", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/{id}/loops": { "get": { "description": "A loop sends a prompt to its chat again and again, as a new message, at an interval or, when it has none, whenever the model asks for the next run. Ended loops stay listed with the reason until you remove them.", "tags": [ "chats" ], "summary": "List the loops of a chat.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The loops of the chat, oldest first", "schema": { "$ref": "#/definitions/schema.ChatsLoopList" } }, "404": { "description": "No such conversation, or loops are off", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "post": { "description": "With an interval (30s, 5m, 2h; at least chats_loop_min_interval, at most 24h) the prompt is sent every interval. Without one the loop is self-paced: after each run the model calls schedule_next to say when to run again, or loop_done to stop, and a run that does neither ends the loop. The prompt is plain text or a skill (/skill-name and its words). The first loop of a chat is pending until you confirm it with PUT .../loops/{loopId} {\"state\":\"active\"}; later ones run at once. A run starts only when the chat is idle.", "tags": [ "chats" ], "summary": "Start a loop in a chat.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true }, { "description": "the interval and the prompt", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsLoopRequest" } } ], "responses": { "201": { "description": "The new loop", "schema": { "$ref": "#/definitions/schema.ChatsLoop" } }, "400": { "description": "The interval or the prompt is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "No such conversation, or loops are off", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "409": { "description": "The chat or you have as many loops as allowed", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "delete": { "tags": [ "chats" ], "summary": "Stop every loop of a chat.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "the number of loops stopped", "schema": { "type": "object", "additionalProperties": { "type": "integer" } } }, "404": { "description": "No such conversation", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/{id}/loops/{loopId}": { "put": { "description": "state paused stops the runs until you make it active again; a run that goes on finishes. state active resumes a paused loop (it runs at once) or confirms a pending one. An ended loop cannot go on.", "tags": [ "chats" ], "summary": "Pause, resume or confirm a loop.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "loop id", "name": "loopId", "in": "path", "required": true }, { "description": "the new state", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsLoopStateRequest" } } ], "responses": { "200": { "description": "The loop", "schema": { "$ref": "#/definitions/schema.ChatsLoop" } }, "400": { "description": "The state is not paused or active, or the loop has ended", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "No such conversation or loop", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "delete": { "description": "The loop is removed and runs no more. A run that goes on is not stopped: stop the chat's turn for that.", "tags": [ "chats" ], "summary": "Stop a loop.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "loop id", "name": "loopId", "in": "path", "required": true } ], "responses": { "200": { "description": "stopped", "schema": { "type": "object", "additionalProperties": { "type": "boolean" } } }, "404": { "description": "No such conversation or loop", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/{id}/mcp": { "put": { "description": "The list replaces the earlier one: the name of a server of the model, or connector:\u003cid\u003e. A switch only takes away; a chat with a saved agent never gets more than the agent grants. The next turn of the chat gets the tools that are on.", "tags": [ "chats" ], "summary": "Switch MCP servers and connectors on and off for a chat.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true }, { "description": "what is off", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsMCPSwitches" } } ], "responses": { "200": { "description": "The tools and their switches now in force", "schema": { "$ref": "#/definitions/schema.ChatsToolsPanel" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "No such conversation, or it is another user's", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/{id}/mcp-apps/call": { "post": { "description": "The page of an MCP App can call tools of its own server. The interface passes the call here. The tool must belong to the server named, the chat must be able to use that server now (the same checks as the resource route), and the tool's _meta.ui.visibility must include \"app\" (the default includes it). A tool in the add-on namespace or with a built-in's name is refused. The call has the timeout of a model's call and its result is cut at 256 KiB. Needs the MCP feature.", "tags": [ "chats" ], "summary": "Call a tool for an MCP App.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true }, { "description": "the call", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsMCPAppCall" } } ], "responses": { "200": { "description": "The MCP result", "schema": { "$ref": "#/definitions/schema.ChatsMCPAppCallResult" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "413": { "description": "The body is over 32 KiB", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/{id}/mcp-apps/resource": { "get": { "description": "An MCP server can declare an interactive page for a tool (_meta.ui.resourceUri). The tool_end event and the transcript line of the call name the server and the resource. This route reads that page from the server, for the interface to show in a sandboxed frame. server is connector:\u003cid\u003e for one of your connectors, or the name of an MCP server of the chat's model. It answers only for a server the chat may use now (not switched off for the chat, granted by the chat's agent if it has one, a connector that is yours and enabled), only for a ui:// resource that a tool of that server declares, and only for text/html up to 4 MiB; anything else is 403. Needs the MCP feature. The answer is not cached and never holds a header or token of the connector.", "tags": [ "chats" ], "summary": "Read the page of an MCP App.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "connector:\u003cid\u003e or the name of an MCP server of the model", "name": "server", "in": "query", "required": true }, { "type": "string", "description": "the ui:// resource", "name": "uri", "in": "query", "required": true } ], "responses": { "200": { "description": "The page and its metadata", "schema": { "$ref": "#/definitions/schema.ChatsMCPAppResource" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/{id}/mcp/prompts": { "get": { "description": "Lists the prompts of the MCP servers of the chat's model and of your connectors that this chat can use now: not switched off for the chat, and granted by its saved agent when it has one. Add one to a message with the context field of POST /api/chats/{id}/messages.", "tags": [ "chats" ], "summary": "List the MCP prompts of a chat.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The prompts", "schema": { "$ref": "#/definitions/schema.ChatsMCPPromptList" } } } }, "post": { "description": "Returns the text of the prompt with the given arguments. 403 mcp_refused when the chat cannot use the server.", "tags": [ "chats" ], "summary": "Expand an MCP prompt.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true }, { "description": "the prompt", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsMCPPromptRequest" } } ], "responses": { "200": { "description": "The expanded prompt", "schema": { "$ref": "#/definitions/schema.ChatsMCPContent" } } } } }, "/api/chats/{id}/mcp/resources": { "get": { "description": "Lists the resources of the MCP servers of the chat's model and of your connectors that this chat can use now. Add one to a message with the context field of POST /api/chats/{id}/messages.", "tags": [ "chats" ], "summary": "List the MCP resources of a chat.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The resources", "schema": { "$ref": "#/definitions/schema.ChatsMCPResourceList" } } } } }, "/api/chats/{id}/mcp/resources/read": { "post": { "description": "Returns the text of the resource (binary parts are left out, the text is cut at 256 KiB). 403 mcp_refused when the chat cannot use the server.", "tags": [ "chats" ], "summary": "Read an MCP resource.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true }, { "description": "the resource", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsMCPReadRequest" } } ], "responses": { "200": { "description": "The resource text", "schema": { "$ref": "#/definitions/schema.ChatsMCPContent" } } } } }, "/api/chats/{id}/messages": { "get": { "tags": [ "chats" ], "summary": "Read a chat's transcript.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "only lines after this sequence number", "name": "after", "in": "query" }, { "type": "integer", "description": "most lines to return (default 200, at most 1000)", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "Transcript lines in order", "schema": { "$ref": "#/definitions/schema.ChatsMessageList" } }, "404": { "description": "No such conversation, or it is another user's", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "post": { "description": "With no turn running the message starts one. With a turn running it waits and reaches the model, with any others, at its next request.\nSend JSON {\"text\"}, or multipart/form-data with a text field and files to attach. Files are saved in the chat's folder of your workspace. With a turn running the files are saved at once and the message waits like any other, with their paths in its text. With skill (a skill of the chat) or agent (a saved agent, when the chat has saved agents on) the message runs with that command; such a message does not wait for a running turn (409). An unknown skill or agent is a 400 that lists what the chat has.", "consumes": [ "application/json", "multipart/form-data" ], "tags": [ "chats" ], "summary": "Send a message to a chat.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true }, { "description": "the message", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsSendRequest" } }, { "type": "file", "description": "files to attach (multipart)", "name": "files", "in": "formData" } ], "responses": { "200": { "description": "Whether a turn started, or the id of the waiting message", "schema": { "$ref": "#/definitions/schema.ChatsSendResponse" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "No such conversation, or it is another user's", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/{id}/messages/{seq}/edit": { "post": { "description": "Replaces the text of your message with the given sequence number, removes everything after it, and starts a new turn. 409 while a turn runs; 400 when the line is not one of your messages.", "tags": [ "chats" ], "summary": "Edit a message you sent and run the chat again from it.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true }, { "type": "integer", "description": "sequence number of the message in the transcript", "name": "seq", "in": "path", "required": true }, { "description": "the new text", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsEditRequest" } } ], "responses": { "200": { "description": "The new turn started", "schema": { "$ref": "#/definitions/schema.ChatsSendResponse" } } } } }, "/api/chats/{id}/pending/{pid}": { "delete": { "tags": [ "chats" ], "summary": "Cancel a message that waits for the model.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "pending message id", "name": "pid", "in": "path", "required": true } ], "responses": { "200": { "description": "cancelled", "schema": { "type": "object", "additionalProperties": { "type": "boolean" } } }, "404": { "description": "No such conversation, or it is another user's", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "patch": { "tags": [ "chats" ], "summary": "Edit a message that waits for the model.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "pending message id", "name": "pid", "in": "path", "required": true }, { "description": "the new text", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsPendingEdit" } } ], "responses": { "200": { "description": "updated", "schema": { "type": "object", "additionalProperties": { "type": "boolean" } } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "No such conversation, or it is another user's", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/{id}/regenerate": { "post": { "description": "Removes everything the model said after your last message (all your messages of that turn stay), then starts a new turn. Files that the removed turn changed stay changed. 409 while a turn runs.", "tags": [ "chats" ], "summary": "Regenerate the last answer.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The new turn started", "schema": { "$ref": "#/definitions/schema.ChatsSendResponse" } } } } }, "/api/chats/{id}/send-now": { "post": { "description": "After a stop or a failed turn the waiting messages stay put. This starts a turn from them.", "tags": [ "chats" ], "summary": "Send the waiting messages now.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "sent", "schema": { "type": "object", "additionalProperties": { "type": "boolean" } } }, "404": { "description": "No such conversation, or it is another user's", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/{id}/skills": { "put": { "description": "The list replaces the earlier one. An entry is a skill name, which turns off the skill that wins so that one of the same name further away shows through, or the id \"layer:name\" from the skill list, which turns off the skill of that layer. The next turn of the chat gets the index without the skills that are off.", "tags": [ "chats" ], "summary": "Switch skills on and off for a chat.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true }, { "description": "the names or ids of the skills that are off", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ChatsSkillSwitches" } } ], "responses": { "200": { "description": "The switches now in force", "schema": { "$ref": "#/definitions/schema.ChatsSkillSwitches" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "No such conversation, or it is another user's", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/{id}/stop": { "post": { "tags": [ "chats" ], "summary": "Stop the running turn.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "stopped", "schema": { "type": "object", "additionalProperties": { "type": "boolean" } } }, "404": { "description": "No such conversation, or it is another user's", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/chats/{id}/tools": { "get": { "description": "The groups of built-in tools (shell, web, files, media, collections, subagents, triggers and saved_agents; a group the server does not offer is absent, and shell is listed even when nothing can run commands, not usable with the reason), add-ons, the MCP servers of the chat's model and your MCP connectors, each with the chat's switch and whether it can be used now (with the reason when not). A chat with a saved agent lists only what the agent grants. fallbacks lists the built-in tools (bash, web_search, web_fetch) that an installed add-on replaces but that no add-on serves in this chat now, with the add-on and whether the built-in serves instead.", "tags": [ "chats" ], "summary": "List the tools a chat can switch on and off.", "parameters": [ { "type": "string", "description": "conversation id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "The tools and their switches", "schema": { "$ref": "#/definitions/schema.ChatsToolsPanel" } }, "400": { "description": "The request is not valid", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "No such conversation, or it is another user's", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/collections": { "get": { "description": "The knowledge-base collections of the caller. An administrator can add all_users=true to also get the other users' collections in user_groups. embedding_model names the model that indexes and searches the collections (collections_embedding_model), and embedding_model_installed says whether this server has it: without it, adding files and searching fail. Needs the collections feature.", "tags": [ "collections" ], "summary": "List your collections.", "responses": { "200": { "description": "The collections", "schema": { "$ref": "#/definitions/schema.CollectionList" } } } }, "post": { "description": "Makes an empty collection under the name in the body.", "tags": [ "collections" ], "summary": "Create a collection.", "parameters": [ { "description": "The name of the collection", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.CollectionCreateRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/schema.CollectionStatus" } } } } }, "/api/collections/{name}/entries": { "get": { "tags": [ "collections" ], "summary": "List the entries of a collection.", "parameters": [ { "type": "string", "description": "Collection name", "name": "name", "in": "path", "required": true } ], "responses": { "200": { "description": "The entries", "schema": { "$ref": "#/definitions/schema.CollectionEntries" } }, "404": { "description": "Collection not found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/collections/{name}/entries-raw/{entry}": { "get": { "description": "Serves the file as it was uploaded.", "tags": [ "collections" ], "summary": "Download the file of an entry.", "parameters": [ { "type": "string", "description": "Collection name", "name": "name", "in": "path", "required": true }, { "type": "string", "description": "Entry key", "name": "entry", "in": "path", "required": true } ], "responses": { "200": { "description": "The original file", "schema": { "type": "file" } }, "404": { "description": "Collection not found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/collections/{name}/entries/{entry}": { "get": { "tags": [ "collections" ], "summary": "Read the text of an entry.", "parameters": [ { "type": "string", "description": "Collection name", "name": "name", "in": "path", "required": true }, { "type": "string", "description": "Entry key", "name": "entry", "in": "path", "required": true } ], "responses": { "200": { "description": "The text and its number of passages", "schema": { "$ref": "#/definitions/schema.CollectionEntryContent" } }, "404": { "description": "Collection not found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/collections/{name}/entry/delete": { "delete": { "tags": [ "collections" ], "summary": "Delete one entry of a collection.", "parameters": [ { "type": "string", "description": "Collection name", "name": "name", "in": "path", "required": true }, { "description": "The entry", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.CollectionEntryDeleteRequest" } } ], "responses": { "200": { "description": "The entries left", "schema": { "$ref": "#/definitions/schema.CollectionEntryDeleteResponse" } }, "404": { "description": "Collection not found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/collections/{name}/reset": { "post": { "description": "Deletes every entry and keeps the collection and the sources it follows.", "tags": [ "collections" ], "summary": "Empty a collection.", "parameters": [ { "type": "string", "description": "Collection name", "name": "name", "in": "path", "required": true } ], "responses": { "200": { "description": "Done", "schema": { "$ref": "#/definitions/schema.CollectionStatus" } }, "404": { "description": "Collection not found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/collections/{name}/search": { "post": { "description": "Returns the passages that match the query best. Asking for more passages than the collection holds returns all of them; an empty collection returns none.", "tags": [ "collections" ], "summary": "Search a collection.", "parameters": [ { "type": "string", "description": "Collection name", "name": "name", "in": "path", "required": true }, { "description": "The query", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.CollectionSearchRequest" } } ], "responses": { "200": { "description": "The passages", "schema": { "$ref": "#/definitions/schema.CollectionSearchResponse" } }, "404": { "description": "Collection not found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/collections/{name}/sources": { "get": { "tags": [ "collections" ], "summary": "List the URLs a collection follows.", "parameters": [ { "type": "string", "description": "Collection name", "name": "name", "in": "path", "required": true } ], "responses": { "200": { "description": "The sources", "schema": { "$ref": "#/definitions/schema.CollectionSources" } }, "404": { "description": "Collection not found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "post": { "description": "The server fetches the URL again at the given interval, in minutes; a value below 1 means 60.", "tags": [ "collections" ], "summary": "Make a collection follow a URL.", "parameters": [ { "type": "string", "description": "Collection name", "name": "name", "in": "path", "required": true }, { "description": "The URL and the interval in minutes", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.CollectionSourceRequest" } } ], "responses": { "200": { "description": "Done", "schema": { "$ref": "#/definitions/schema.CollectionStatus" } }, "404": { "description": "Collection not found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "delete": { "tags": [ "collections" ], "summary": "Stop a collection following a URL.", "parameters": [ { "type": "string", "description": "Collection name", "name": "name", "in": "path", "required": true }, { "description": "The URL", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.CollectionSourceRequest" } } ], "responses": { "200": { "description": "Done", "schema": { "$ref": "#/definitions/schema.CollectionStatus" } }, "404": { "description": "Collection not found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/collections/{name}/upload": { "post": { "description": "Uploads a file as multipart form field ` + "`" + `file` + "`" + `. The server cuts it into passages and embeds them with the collections embedding model. 409 when the embedding model changed and the vectors have another size.", "tags": [ "collections" ], "summary": "Add a file to a collection.", "parameters": [ { "type": "string", "description": "Collection name", "name": "name", "in": "path", "required": true }, { "type": "file", "description": "The file to add", "name": "file", "in": "formData", "required": true } ], "responses": { "200": { "description": "The entry key", "schema": { "$ref": "#/definitions/schema.CollectionStatus" } }, "404": { "description": "Collection not found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "409": { "description": "The embedding model changed", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/failover": { "get": { "produces": [ "application/json" ], "tags": [ "failover" ], "summary": "List failover chains and the health of their targets", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/localai.FailoverChainsResponse" } } } } }, "/api/failover/events": { "get": { "description": "The first event is \"snapshot\" with the full state, then \"chain.switched\" and \"target.state\" events.", "produces": [ "text/event-stream" ], "tags": [ "failover" ], "summary": "Stream failover events (server-sent events)", "responses": { "200": { "description": "OK" } } } }, "/api/failover/{chain}": { "get": { "produces": [ "application/json" ], "tags": [ "failover" ], "summary": "Get one failover chain", "parameters": [ { "type": "string", "description": "Chain name", "name": "chain", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/failover.ChainStatus" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/failover/{chain}/pin": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "failover" ], "summary": "Pin a failover chain to one target", "parameters": [ { "type": "string", "description": "Chain name", "name": "chain", "in": "path", "required": true }, { "description": "Target to pin", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/localai.FailoverPinRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/failover.ChainStatus" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "delete": { "produces": [ "application/json" ], "tags": [ "failover" ], "summary": "Remove the pin from a failover chain", "parameters": [ { "type": "string", "description": "Chain name", "name": "chain", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/failover.ChainStatus" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/fine-tuning/status": { "get": { "description": "Returns model_exports=false when this instance does not share the models path of the add-on owner. The value is the same as the model_exports key of GET /api/features.", "produces": [ "application/json" ], "tags": [ "fine-tuning", "quantization" ], "summary": "Report whether model exports are allowed", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/localai.ModelExportsStatus" } }, "503": { "description": "add-ons are off or the owner is not reachable", "schema": { "type": "object", "additionalProperties": true } } } } }, "/api/instructions": { "get": { "description": "Returns a compact list of instruction areas with descriptions and URLs for detailed guides", "produces": [ "application/json" ], "tags": [ "instructions" ], "summary": "List available API instruction areas", "responses": { "200": { "description": "instructions list with hint", "schema": { "type": "object", "additionalProperties": true } } } } }, "/api/instructions/{name}": { "get": { "description": "Returns a markdown guide (default) or filtered OpenAPI fragment (format=json) for a named instruction", "produces": [ "application/json", "text/markdown" ], "tags": [ "instructions" ], "summary": "Get an instruction's API guide or OpenAPI fragment", "parameters": [ { "type": "string", "description": "Instruction name (e.g. chat-inference, config-management)", "name": "name", "in": "path", "required": true }, { "type": "string", "description": "Response format: json for OpenAPI fragment, omit for markdown", "name": "format", "in": "query" } ], "responses": { "200": { "description": "instruction documentation", "schema": { "$ref": "#/definitions/localai.APIInstructionResponse" } }, "404": { "description": "instruction not found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/library/sources": { "get": { "description": "Every library source of the add-on, backend and model kinds, with its state: kind, id, name, url, enabled (what the host does with it), default (shipped), removed (a default the user removed; a tombstone), suspended (a default while the official libraries are off), the conflict message when it clashes with another source, and the last fetch state when there is one. Administrators only.", "produces": [ "application/json" ], "tags": [ "library" ], "summary": "List the library sources", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/localai.LibrarySourcesResponse" } }, "503": { "description": "on a frontend: the add-on owner is not reachable, does not serve library calls, or runs on another platform; the message says which", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "post": { "description": "Adds a source of your own. kind is addon, backend or model; format is library (default) or gallery. The id is derived from the name or URL when it is empty. A source with the same kind and URL is refused (409), as is a taken id. Administrators only.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "library" ], "summary": "Add a library source", "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/library.Info" } }, "503": { "description": "on a frontend: the add-on owner is not reachable, does not serve library calls, or runs on another platform; the message says which", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/library/sources/{id}": { "put": { "description": "Replaces the mirrors of a model or backend source; an empty list clears them. Each mirror is an http(s), github:, oci:// or file:// address. Administrators only.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "library" ], "summary": "Change the mirrors of a library source", "parameters": [ { "type": "string", "description": "Source id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/library.Info" } }, "503": { "description": "on a frontend: the add-on owner is not reachable, does not serve library calls, or runs on another platform; the message says which", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "delete": { "description": "A source of your own is deleted. A shipped default is not: it stays as a tombstone (removed true), so it does not come back at the next start; enabling it brings it back. Administrators only.", "produces": [ "application/json" ], "tags": [ "library" ], "summary": "Remove a library source", "parameters": [ { "type": "string", "description": "Source id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": true } }, "503": { "description": "on a frontend: the add-on owner is not reachable, does not serve library calls, or runs on another platform; the message says which", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/library/sources/{id}/disable": { "post": { "description": "Enabling a removed default brings it back. Administrators only.", "produces": [ "application/json" ], "tags": [ "library" ], "summary": "Turn a library source on or off", "parameters": [ { "type": "string", "description": "Source id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/library.Info" } }, "503": { "description": "on a frontend: the add-on owner is not reachable, does not serve library calls, or runs on another platform; the message says which", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/library/sources/{id}/enable": { "post": { "description": "Enabling a removed default brings it back. Administrators only.", "produces": [ "application/json" ], "tags": [ "library" ], "summary": "Turn a library source on or off", "parameters": [ { "type": "string", "description": "Source id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/library.Info" } }, "503": { "description": "on a frontend: the add-on owner is not reachable, does not serve library calls, or runs on another platform; the message says which", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/models/config-json/{name}": { "patch": { "description": "Deep-merges the JSON patch body into the existing model config", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "config" ], "summary": "Partially update a model configuration", "parameters": [ { "type": "string", "description": "Model name", "name": "name", "in": "path", "required": true } ], "responses": { "200": { "description": "success message", "schema": { "type": "object", "additionalProperties": true } } } } }, "/api/models/config-metadata": { "get": { "description": "Returns config field metadata. Use ?section=\u003cid\u003e to filter by section, or omit for a section index.", "produces": [ "application/json" ], "tags": [ "config" ], "summary": "List model configuration field metadata", "parameters": [ { "type": "string", "description": "Section ID to filter (e.g. 'general', 'llm', 'parameters') or 'all' for everything", "name": "section", "in": "query" } ], "responses": { "200": { "description": "Section index or filtered field metadata", "schema": { "type": "object", "additionalProperties": true } } } } }, "/api/models/config-metadata/autocomplete/{provider}": { "get": { "description": "Returns runtime-resolved values for dynamic providers (backends, models)", "produces": [ "application/json" ], "tags": [ "config" ], "summary": "Get dynamic autocomplete values for a config field", "parameters": [ { "type": "string", "description": "Provider name (backends, models, models:chat, models:tts, models:transcript, models:vad)", "name": "provider", "in": "path", "required": true } ], "responses": { "200": { "description": "values array", "schema": { "type": "object", "additionalProperties": true } } } } }, "/api/models/storage": { "get": { "description": "Per-model disk usage, shared-file relations and missing references under the models path", "produces": [ "application/json" ], "tags": [ "models" ], "summary": "Report model storage usage on disk", "responses": { "200": { "description": "storage report", "schema": { "$ref": "#/definitions/gallery.StorageIndex" } } } } }, "/api/models/toggle-pinned/{name}/{action}": { "put": { "description": "Pin or unpin a model. Pinned models stay loaded and are excluded from automatic eviction.", "tags": [ "config" ], "summary": "Toggle model pinned status", "parameters": [ { "type": "string", "description": "Model name", "name": "name", "in": "path", "required": true }, { "type": "string", "description": "Action: 'pin' or 'unpin'", "name": "action", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/localai.ModelResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/localai.ModelResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/localai.ModelResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/localai.ModelResponse" } } } } }, "/api/models/vram-estimate": { "post": { "description": "Estimates VRAM based on model weight files at multiple context sizes", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "config" ], "summary": "Estimate VRAM usage for a model", "parameters": [ { "description": "VRAM estimation parameters", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/modeladmin.VRAMRequest" } } ], "responses": { "200": { "description": "VRAM estimate", "schema": { "$ref": "#/definitions/modeladmin.VRAMResponse" } } } } }, "/api/models/{id}/load-cancel": { "post": { "description": "Cancels the load attempt named by ` + "`" + `job_id` + "`" + ` and stops its remote work. 200 means the attempt is gone or the worker confirmed the stop. 202 means the cancel is recorded and the stop is pending; the model is released after ` + "`" + `retry_after` + "`" + ` seconds regardless. 409 means a different attempt is current and carries its ` + "`" + `current_job_id` + "`" + `. Repeating the call is safe and does not extend the hold.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "models" ], "summary": "Cancel one distributed model load.", "parameters": [ { "type": "string", "description": "Model ID", "name": "id", "in": "path", "required": true }, { "description": "The exact attempt to cancel", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ModelLoadCancelRequest" } } ], "responses": { "200": { "description": "Stopped, or no such load any more", "schema": { "$ref": "#/definitions/schema.ModelLoadCancelResponse" } }, "202": { "description": "Cancel recorded; stop pending", "schema": { "$ref": "#/definitions/schema.ModelLoadCancelResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "Unknown model", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "409": { "description": "A different attempt is current", "schema": { "$ref": "#/definitions/schema.ModelLoadCancelResponse" } } } } }, "/api/models/{id}/load-status": { "get": { "description": "Returns the live state of a distributed cold load: job id, phase, node, byte progress, ETA, lease freshness, and for a failed attempt the cause, whether the stop is pending and when the model is released. 404 means no load exists for the model. A database error is 503, never an empty answer. This is the same ` + "`" + `loading` + "`" + ` object the 503 response carries while a model is still staging.", "produces": [ "application/json" ], "tags": [ "models" ], "summary": "Report the progress of an in-flight model load.", "parameters": [ { "type": "string", "description": "Model ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "Live load progress", "schema": { "$ref": "#/definitions/schema.ModelLoadingStatus" } }, "404": { "description": "No load is running for this model", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "503": { "description": "The job table could not be read", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/models/{name}/{action}": { "put": { "description": "Enable or disable a model from being loaded on demand. Disabled models remain installed but cannot be loaded.", "tags": [ "config" ], "summary": "Toggle model enabled/disabled status", "parameters": [ { "type": "string", "description": "Model name", "name": "name", "in": "path", "required": true }, { "type": "string", "description": "Action: 'enable' or 'disable'", "name": "action", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/localai.ModelResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/localai.ModelResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/localai.ModelResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/localai.ModelResponse" } } } } }, "/api/motion/sessions": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "motion" ], "summary": "Create a motion capture session", "parameters": [ { "description": "Model, output profile and source clock origin", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/localai.MotionSessionRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/localai.MotionSessionInfo" } } } } }, "/api/motion/sessions/{id}": { "get": { "tags": [ "motion" ], "summary": "Get motion session status", "parameters": [ { "type": "string", "description": "Session ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/localai.MotionSessionInfo" } } } }, "delete": { "tags": [ "motion" ], "summary": "Close a motion session", "parameters": [ { "type": "string", "description": "Session ID", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" } } } }, "/api/motion/sessions/{id}/poses": { "get": { "tags": [ "motion" ], "summary": "Stream motion frames and poses over a duplex WebSocket", "parameters": [ { "type": "string", "description": "Session ID", "name": "id", "in": "path", "required": true } ], "responses": { "101": { "description": "Switching Protocols" } } } }, "/api/motion/sessions/{id}/tickets": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "motion" ], "summary": "Issue a motion WebSocket ticket (30 seconds, single use)", "parameters": [ { "type": "string", "description": "Session ID", "name": "id", "in": "path", "required": true }, { "description": "Browser origin", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/localai.MotionTicketRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/auth.WebSocketTicketResponse" } } } } }, "/api/nodes/models": { "get": { "tags": [ "Nodes" ], "summary": "List all loaded models cluster-wide", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/nodes.NodeModel" } } } } } }, "/api/nodes/{id}/max-replicas-per-model": { "put": { "tags": [ "Nodes" ], "summary": "Update a node's max replicas per model", "parameters": [ { "type": "string", "description": "Node ID", "name": "id", "in": "path", "required": true }, { "description": "New value", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/localai.UpdateMaxReplicasPerModelRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "integer" } } }, "400": { "description": "value must be \u003e= 1", "schema": { "type": "object", "additionalProperties": true } }, "404": { "description": "node not found", "schema": { "type": "object", "additionalProperties": true } } } }, "delete": { "tags": [ "Nodes" ], "summary": "Reset a node's max replicas per model to the worker default", "parameters": [ { "type": "string", "description": "Node ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "boolean" } } }, "404": { "description": "node not found", "schema": { "type": "object", "additionalProperties": true } } } } }, "/api/nodes/{id}/vram-budget": { "put": { "tags": [ "Nodes" ], "summary": "Update a node's VRAM allocation budget", "parameters": [ { "type": "string", "description": "Node ID", "name": "id", "in": "path", "required": true }, { "description": "New value (\\", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/localai.UpdateVRAMBudgetRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "400": { "description": "invalid budget", "schema": { "type": "object", "additionalProperties": true } }, "404": { "description": "node not found", "schema": { "type": "object", "additionalProperties": true } } } }, "delete": { "tags": [ "Nodes" ], "summary": "Reset a node's VRAM budget to the worker default", "parameters": [ { "type": "string", "description": "Node ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "additionalProperties": { "type": "boolean" } } }, "404": { "description": "node not found", "schema": { "type": "object", "additionalProperties": true } } } } }, "/api/p2p": { "get": { "tags": [ "p2p" ], "summary": "Returns available P2P nodes", "responses": { "200": { "description": "Response", "schema": { "type": "array", "items": { "$ref": "#/definitions/schema.P2PNodesResponse" } } } } } }, "/api/p2p/token": { "get": { "tags": [ "p2p" ], "summary": "Show the P2P token", "responses": { "200": { "description": "Response", "schema": { "type": "string" } } } } }, "/api/pii/analyze": { "post": { "description": "Runs the configured PII detectors (NER and/or pattern tiers) over the supplied text and returns the matched entity spans with the policy action that would fire. Detection only — the text is not modified and no block is enforced. Select detectors explicitly via ` + "`" + `detectors` + "`" + `, or pass a consuming ` + "`" + `model` + "`" + ` to use its effective policy: the model's own ` + "`" + `pii.detectors` + "`" + `, else the instance-wide ` + "`" + `pii_default_detectors` + "`" + `. A model with PII disabled, or enabled with nothing to scan with, is a 400. The raw matched value is never returned; admins may set ` + "`" + `reveal:true` + "`" + ` for the audit hash prefix.", "tags": [ "pii" ], "summary": "Detect PII entities in a string (no mutation).", "parameters": [ { "description": "text + detector selection", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.PIIAnalyzeRequest" } } ], "responses": { "200": { "description": "Detected entities", "schema": { "$ref": "#/definitions/schema.PIIAnalyzeResponse" } } } } }, "/api/pii/redact": { "post": { "description": "Runs the configured PII detectors over the text and applies each detector model's policy: masked spans are replaced with ` + "`" + `[REDACTED:\u003cid\u003e]` + "`" + `, allow spans pass through, and a single block action causes a 400 (type ` + "`" + `pii_blocked` + "`" + `) carrying the offending entities — the text is never returned in that case. Select detectors via ` + "`" + `detectors` + "`" + `, or a consuming ` + "`" + `model` + "`" + `'s effective policy (its own ` + "`" + `pii.detectors` + "`" + `, else the instance-wide ` + "`" + `pii_default_detectors` + "`" + `; PII must be enabled on the model). Records audit events (origin ` + "`" + `pii_redact` + "`" + `) visible at /api/pii/events.", "tags": [ "pii" ], "summary": "Redact PII in a string by applying the configured policy.", "parameters": [ { "description": "text + detector selection", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.PIIAnalyzeRequest" } } ], "responses": { "200": { "description": "Redacted text + entities", "schema": { "$ref": "#/definitions/schema.PIIRedactResponse" } } } } }, "/api/quantization/status": { "get": { "description": "Returns model_exports=false when this instance does not share the models path of the add-on owner. The value is the same as the model_exports key of GET /api/features.", "produces": [ "application/json" ], "tags": [ "fine-tuning", "quantization" ], "summary": "Report whether model imports are allowed", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/localai.ModelExportsStatus" } }, "503": { "description": "add-ons are off or the owner is not reachable", "schema": { "type": "object", "additionalProperties": true } } } } }, "/api/router/decide": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "router" ], "summary": "Classify a prompt against a router model's policies (decision oracle)", "parameters": [ { "description": "decide params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.RouterDecideRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/schema.RouterDecideResponse" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "503": { "description": "Service Unavailable", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/router/{name}/corpus": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "router" ], "summary": "Seed the KNN routing corpus with labelled example prompts", "parameters": [ { "type": "string", "description": "router model name", "name": "name", "in": "path", "required": true }, { "description": "labelled exemplars", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.RouterCorpusAddRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/schema.RouterCorpusAddResponse" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "delete": { "produces": [ "application/json" ], "tags": [ "router" ], "summary": "Clear a router's KNN corpus", "parameters": [ { "type": "string", "description": "router model name", "name": "name", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/schema.RouterCorpusClearResponse" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/router/{name}/corpus/stats": { "get": { "produces": [ "application/json" ], "tags": [ "router" ], "summary": "Inspect a router's KNN corpus (label counts only, never texts)", "parameters": [ { "type": "string", "description": "router model name", "name": "name", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/schema.RouterCorpusStatsResponse" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/api/traces": { "get": { "description": "Returns a bounded, newest-first page of captured API exchange traces. Request and response bodies plus headers are omitted unless full=true; fetch them per-trace from /api/traces/{id}. Paging metadata is returned in the X-Total-Count, X-Trace-Offset and X-Trace-Limit headers.", "produces": [ "application/json" ], "tags": [ "monitoring" ], "summary": "List API request/response traces", "parameters": [ { "type": "integer", "description": "Maximum entries to return (default 50, max 1000, 0 for all)", "name": "limit", "in": "query" }, { "type": "integer", "description": "Number of entries to skip (default 0)", "name": "offset", "in": "query" }, { "type": "boolean", "description": "Include request/response bodies and headers (default false)", "name": "full", "in": "query" } ], "responses": { "200": { "description": "Traced API exchanges", "schema": { "type": "object", "additionalProperties": true } } } } }, "/api/traces/clear": { "post": { "description": "Removes all captured API request/response traces from the buffer", "tags": [ "monitoring" ], "summary": "Clear API traces", "responses": { "204": { "description": "Traces cleared" } } } }, "/api/traces/summary": { "get": { "description": "Returns request, failure and latency totals over a recent window, plus a bucketed series for sparklines. Exists so callers wanting three numbers do not have to fetch the whole trace list and count it themselves.", "produces": [ "application/json" ], "tags": [ "monitoring" ], "summary": "Summarize recent API traces", "parameters": [ { "type": "integer", "description": "Window in hours (default 24, max 168)", "name": "hours", "in": "query" } ], "responses": { "200": { "description": "Counted trace totals", "schema": { "$ref": "#/definitions/middleware.TraceSummary" } } } } }, "/api/traces/{id}": { "get": { "description": "Returns a single captured API exchange, including the request and response bodies omitted from the list response", "produces": [ "application/json" ], "tags": [ "monitoring" ], "summary": "Get one API trace", "parameters": [ { "type": "string", "description": "Trace ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "Traced API exchange", "schema": { "type": "object", "additionalProperties": true } }, "404": { "description": "Trace not found", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/voice-profiles": { "get": { "description": "List saved voice-cloning references without exposing filesystem paths.", "produces": [ "application/json" ], "tags": [ "audio", "voice-profiles" ], "summary": "List voice profiles", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/localai.VoiceProfileListResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "post": { "description": "Save a consent-confirmed PCM WAV reference clip and exact transcript for voice cloning. Admin-only.", "consumes": [ "multipart/form-data", "application/json" ], "produces": [ "application/json" ], "tags": [ "audio", "voice-profiles" ], "summary": "Create a voice profile", "parameters": [ { "type": "string", "description": "Display name", "name": "name", "in": "formData", "required": true }, { "type": "string", "description": "Optional description", "name": "description", "in": "formData" }, { "type": "string", "description": "Optional language tag", "name": "language", "in": "formData" }, { "type": "string", "description": "Exact transcript of the reference clip", "name": "transcript", "in": "formData", "required": true }, { "type": "boolean", "description": "Confirms authorization to clone the voice", "name": "consent_confirmed", "in": "formData", "required": true }, { "type": "file", "description": "16-bit PCM WAV, preferably mono 24 kHz, 1-120 seconds, up to 50 MiB", "name": "audio", "in": "formData", "required": true } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/voiceprofile.Profile" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "413": { "description": "Request Entity Too Large", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/voice-profiles/{id}": { "delete": { "description": "Permanently remove a saved voice-cloning profile. Admin-only.", "tags": [ "audio", "voice-profiles" ], "summary": "Delete a voice profile", "parameters": [ { "type": "string", "description": "Voice profile UUID", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/voice-profiles/{id}/audio": { "get": { "description": "Stream the saved reference WAV for an authenticated TTS user.", "produces": [ "audio/x-wav" ], "tags": [ "audio", "voice-profiles" ], "summary": "Preview voice profile audio", "parameters": [ { "type": "string", "description": "Voice profile UUID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/api/workspace/events": { "get": { "description": "Server-sent events: a \"change\" event when files in your home folder change, whoever changed them (you in another tab, a chat, a trigger, a connector, an API client, on any frontend), with the paths inside your home and the revision as the event id. Changes that arrive close together come as one event. A \"resync\" event means changes were left out (the client fell behind, or the resume point is too far back): read again what you show. Send the last id back as the Last-Event-ID header or the after query parameter to resume; without it the stream starts from now. A comment line is sent every 25 seconds. At most 8 streams per user.", "produces": [ "text/event-stream" ], "tags": [ "workspace" ], "summary": "Stream the changes to your files.", "parameters": [ { "type": "integer", "description": "resume after this revision", "name": "after", "in": "query" }, { "type": "integer", "description": "resume after this revision (sent by a browser when it reconnects)", "name": "Last-Event-ID", "in": "header" } ], "responses": { "200": { "description": "An event stream", "schema": { "$ref": "#/definitions/schema.WorkspaceChange" } }, "400": { "description": "The resume point is not a number", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "409": { "description": "Files are off on this server", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "429": { "description": "Too many streams for this user", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/audio/transform": { "post": { "description": "Runs an audio-in / audio-out transform conditioned on an optional auxiliary reference signal. Concrete transforms include AEC + noise suppression + dereverberation (LocalVQE), voice conversion (reference = target speaker), and pitch shifting. The backend determines the operation; pass model-specific tuning via repeated ` + "`" + `params[\u003ckey\u003e]=\u003cvalue\u003e` + "`" + ` form fields.", "consumes": [ "multipart/form-data" ], "produces": [ "audio/x-wav" ], "tags": [ "audio" ], "summary": "Transform audio (echo cancellation, noise suppression, voice conversion, etc.)", "parameters": [ { "type": "string", "description": "model", "name": "model", "in": "formData", "required": true }, { "type": "file", "description": "primary input audio file", "name": "audio", "in": "formData", "required": true }, { "type": "file", "description": "auxiliary reference audio (loopback for AEC, target voice for conversion, etc.)", "name": "reference", "in": "formData" }, { "type": "string", "description": "wav | mp3 | ogg | flac", "name": "response_format", "in": "formData" }, { "type": "integer", "description": "desired output sample rate in Hz; omit for the backend's own rate, otherwise 8000-192000", "name": "sample_rate", "in": "formData" } ], "responses": { "200": { "description": "transformed audio file", "schema": { "type": "string" } } } } }, "/audio/transformations": { "post": { "description": "Runs an audio-in / audio-out transform conditioned on an optional auxiliary reference signal. Concrete transforms include AEC + noise suppression + dereverberation (LocalVQE), voice conversion (reference = target speaker), and pitch shifting. The backend determines the operation; pass model-specific tuning via repeated ` + "`" + `params[\u003ckey\u003e]=\u003cvalue\u003e` + "`" + ` form fields.", "consumes": [ "multipart/form-data" ], "produces": [ "audio/x-wav" ], "tags": [ "audio" ], "summary": "Transform audio (echo cancellation, noise suppression, voice conversion, etc.)", "parameters": [ { "type": "string", "description": "model", "name": "model", "in": "formData", "required": true }, { "type": "file", "description": "primary input audio file", "name": "audio", "in": "formData", "required": true }, { "type": "file", "description": "auxiliary reference audio (loopback for AEC, target voice for conversion, etc.)", "name": "reference", "in": "formData" }, { "type": "string", "description": "wav | mp3 | ogg | flac", "name": "response_format", "in": "formData" }, { "type": "integer", "description": "desired output sample rate in Hz; omit for the backend's own rate, otherwise 8000-192000", "name": "sample_rate", "in": "formData" } ], "responses": { "200": { "description": "transformed audio file", "schema": { "type": "string" } } } } }, "/audio/transformations/stream": { "get": { "description": "Streams binary PCM frames in (interleaved stereo: ch0=audio, ch1=reference) and out (mono). The model must support the audio_transform use case. Any-to-any realtime_audio models use the OpenAI Realtime API instead. The first message must be a JSON ` + "`" + `session.update` + "`" + ` envelope describing model + sample format + frame size + backend params. Server emits binary PCM on the same cadence.", "tags": [ "audio" ], "summary": "Bidirectional realtime audio transform over WebSocket.", "responses": {} } }, "/backend/load": { "post": { "description": "Loads the named model (or, for a realtime pipeline, all of its sub-models) into memory so subsequent requests pay no cold-start cost. The inverse of /backend/shutdown.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "monitoring" ], "summary": "Pre-load a model into memory", "parameters": [ { "description": "Model to load", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ModelLoadRequest" } } ], "responses": { "200": { "description": "Model loaded", "schema": { "$ref": "#/definitions/schema.ModelLoadResponse" } }, "400": { "description": "Missing model name", "schema": { "$ref": "#/definitions/schema.ModelLoadResponse" } }, "500": { "description": "Load failed (Loaded lists any sub-models that did load)", "schema": { "$ref": "#/definitions/schema.ModelLoadResponse" } } } } }, "/backend/monitor": { "get": { "tags": [ "monitoring" ], "summary": "Backend monitor endpoint", "parameters": [ { "type": "string", "description": "Name of the model to monitor", "name": "model", "in": "query", "required": true } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/proto.StatusResponse" } } } } }, "/backend/shutdown": { "post": { "tags": [ "monitoring" ], "summary": "Backend shutdown endpoint", "parameters": [ { "description": "Backend statistics request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.BackendMonitorRequest" } } ], "responses": {} } }, "/backends": { "get": { "tags": [ "backends" ], "summary": "List all Backends", "responses": { "200": { "description": "Response", "schema": { "type": "array", "items": { "$ref": "#/definitions/gallery.GalleryBackend" } } } } } }, "/backends/apply": { "post": { "tags": [ "backends" ], "summary": "Install backends to LocalAI.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/localai.GalleryBackend" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.BackendResponse" } }, "403": { "description": "Backend installation is disabled on this server (code backend_install_disabled)", "schema": { "type": "object", "additionalProperties": true } }, "409": { "description": "Hardware-specific build in distributed mode (code concrete_backend_requires_target)", "schema": { "type": "object", "additionalProperties": true } } } } }, "/backends/available": { "get": { "tags": [ "backends" ], "summary": "List all available Backends", "responses": { "200": { "description": "Response", "schema": { "type": "array", "items": { "$ref": "#/definitions/gallery.GalleryBackend" } } } } } }, "/backends/delete/{name}": { "post": { "tags": [ "backends" ], "summary": "delete backends from LocalAI.", "parameters": [ { "type": "string", "description": "Backend name", "name": "name", "in": "path", "required": true } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.BackendResponse" } } } } }, "/backends/galleries": { "get": { "tags": [ "backends" ], "summary": "List all Galleries", "responses": { "200": { "description": "Response", "schema": { "type": "array", "items": { "$ref": "#/definitions/config.Gallery" } } } } } }, "/backends/jobs": { "get": { "tags": [ "backends" ], "summary": "Returns all the jobs status progress", "responses": { "200": { "description": "Response", "schema": { "type": "object", "additionalProperties": { "$ref": "#/definitions/galleryop.OpStatus" } } } } } }, "/backends/jobs/{uuid}": { "get": { "tags": [ "backends" ], "summary": "Returns the job status", "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/galleryop.OpStatus" } } } } }, "/backends/known": { "get": { "tags": [ "backends" ], "summary": "List all known Backends (importer registry + curated pref-only + installed-on-disk)", "responses": { "200": { "description": "Response", "schema": { "type": "array", "items": { "$ref": "#/definitions/schema.KnownBackend" } } } } } }, "/backends/library/install": { "post": { "tags": [ "backends" ], "summary": "Install a backend from a library entry on this node.", "parameters": [ { "description": "library, backend name and version", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/localai.BackendLibraryInstallRequest" } } ], "responses": { "200": { "description": "the job; read its status at the status URL", "schema": { "$ref": "#/definitions/schema.BackendResponse" } }, "400": { "description": "the request does not name an entry", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "409": { "description": "the same backend is already being installed", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "503": { "description": "on a frontend: the add-on owner is not reachable, does not serve library calls, or runs on another platform; the message says which", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/backends/library/updates": { "get": { "tags": [ "backends" ], "summary": "List the installed library backends with a newer build in their library.", "responses": { "200": { "description": "updates", "schema": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/backendlib.Update" } } } }, "503": { "description": "on a frontend: the add-on owner is not reachable, does not serve library calls, or runs on another platform; the message says which", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/backends/upgrade/{name}": { "post": { "tags": [ "backends" ], "summary": "Upgrade a backend", "parameters": [ { "type": "string", "description": "Backend name", "name": "name", "in": "path", "required": true } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.BackendResponse" } }, "403": { "description": "Backend installation is disabled on this server (code backend_install_disabled)", "schema": { "type": "object", "additionalProperties": true } } } } }, "/backends/upgrades": { "get": { "tags": [ "backends" ], "summary": "Get available backend upgrades", "responses": { "200": { "description": "Response", "schema": { "type": "object", "additionalProperties": { "$ref": "#/definitions/gallery.UpgradeInfo" } } } } } }, "/backends/upgrades/check": { "post": { "tags": [ "backends" ], "summary": "Force backend upgrade check", "responses": { "200": { "description": "Response", "schema": { "type": "object", "additionalProperties": { "$ref": "#/definitions/gallery.UpgradeInfo" } } } } } }, "/branding/asset/{kind}": { "get": { "description": "Serves the admin-uploaded logo, horizontal logo, or favicon. 404 when no override is set.", "produces": [ "image/*" ], "tags": [ "branding" ], "summary": "Serve a custom branding asset", "parameters": [ { "type": "string", "description": "Asset kind: logo, logo_horizontal, or favicon", "name": "kind", "in": "path", "required": true } ], "responses": { "200": { "description": "OK" }, "404": { "description": "Not Found" } } } }, "/metrics": { "get": { "produces": [ "text/plain" ], "tags": [ "monitoring" ], "summary": "Prometheus metrics endpoint", "responses": { "200": { "description": "Prometheus metrics", "schema": { "type": "string" } } } } }, "/models/apply": { "post": { "tags": [ "models" ], "summary": "Install models to LocalAI.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/localai.GalleryModel" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.GalleryResponse" } }, "409": { "description": "The model's backend is not installed and backend installation is disabled (code backend_not_installed)", "schema": { "type": "object", "additionalProperties": true } } } } }, "/models/available": { "get": { "tags": [ "models" ], "summary": "List installable models.", "responses": { "200": { "description": "Response", "schema": { "type": "array", "items": { "$ref": "#/definitions/gallery.Metadata" } } } } } }, "/models/delete/{name}": { "post": { "tags": [ "models" ], "summary": "delete models to LocalAI.", "parameters": [ { "type": "string", "description": "Model name", "name": "name", "in": "path", "required": true } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.GalleryResponse" } } } } }, "/models/galleries": { "get": { "tags": [ "models" ], "summary": "List all Galleries", "responses": { "200": { "description": "Response", "schema": { "type": "array", "items": { "$ref": "#/definitions/config.Gallery" } } } } } }, "/models/import": { "post": { "description": "Writes the posted model configuration. A config referencing\nremote assets (download_files entries, URI-valued model/mmproj)\nis enqueued on the gallery job queue and answered with a job id\nplus status URL to poll, like a gallery install; a config with\nno downloads is written synchronously and answered with a\nplain success response. A queued import runs the gallery\ninstaller, which also adds recommended inference defaults the\nconfig leaves unset and installs the backend when automatic\nbackend installation is enabled; the synchronous path stores\nthe body as posted.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "models" ], "summary": "Import a model from a raw YAML or JSON configuration", "parameters": [ { "description": "model configuration (YAML or JSON body)", "name": "request", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "remote assets present: job id and status URL", "schema": { "$ref": "#/definitions/schema.GalleryResponse" } }, "400": { "description": "invalid or incomplete configuration", "schema": { "$ref": "#/definitions/localai.ModelResponse" } } } } }, "/models/jobs": { "get": { "tags": [ "models" ], "summary": "Returns all the jobs status progress", "responses": { "200": { "description": "Response", "schema": { "type": "object", "additionalProperties": { "$ref": "#/definitions/galleryop.OpStatus" } } } } } }, "/models/jobs/{uuid}": { "get": { "tags": [ "models" ], "summary": "Returns the job status", "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/galleryop.OpStatus" } } } } }, "/system": { "get": { "tags": [ "monitoring" ], "summary": "Show the LocalAI instance information", "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.SystemInformationResponse" } } } } }, "/tokenMetrics": { "get": { "consumes": [ "application/json" ], "produces": [ "audio/x-wav" ], "tags": [ "tokenize" ], "summary": "Get TokenMetrics for Active Slot.", "responses": { "200": { "description": "generated audio/wav file", "schema": { "type": "string" } } } } }, "/tts": { "post": { "consumes": [ "application/json" ], "produces": [ "audio/x-wav" ], "tags": [ "audio" ], "summary": "Generates audio from the input text.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.TTSRequest" } } ], "responses": { "200": { "description": "generated audio/wav file", "schema": { "type": "string" } } } } }, "/v1/audio/classification": { "post": { "consumes": [ "multipart/form-data" ], "tags": [ "audio" ], "summary": "Classify sound events in audio (audio tagging).", "parameters": [ { "type": "string", "description": "model", "name": "model", "in": "formData", "required": true }, { "type": "file", "description": "audio file", "name": "file", "in": "formData", "required": true }, { "type": "integer", "description": "number of top tags to return (0 = backend default)", "name": "top_k", "in": "formData" }, { "type": "number", "description": "drop tags scoring below this value", "name": "threshold", "in": "formData" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/schema.SoundClassificationResult" } } } } }, "/v1/audio/diarization": { "post": { "description": "JSON accepts model, file (raw base64 audio), include_text, include_speaker_profiles, include_sounds and response_format. Profiles require voice-recognition permission and json or verbose_json; unsupported backends return 501.", "consumes": [ "multipart/form-data", "application/json" ], "tags": [ "audio" ], "summary": "Identify speakers in audio (who spoke when).", "parameters": [ { "type": "string", "description": "model", "name": "model", "in": "formData", "required": true }, { "type": "file", "description": "audio file", "name": "file", "in": "formData", "required": true }, { "type": "integer", "description": "exact speaker count (\u003e0 forces; 0 = auto)", "name": "num_speakers", "in": "formData" }, { "type": "integer", "description": "lower bound when auto-detecting", "name": "min_speakers", "in": "formData" }, { "type": "integer", "description": "upper bound when auto-detecting", "name": "max_speakers", "in": "formData" }, { "type": "number", "description": "clustering distance threshold when num_speakers is unknown", "name": "clustering_threshold", "in": "formData" }, { "type": "number", "description": "discard segments shorter than this (seconds)", "name": "min_duration_on", "in": "formData" }, { "type": "number", "description": "merge gaps shorter than this (seconds)", "name": "min_duration_off", "in": "formData" }, { "type": "string", "description": "audio language hint (only meaningful for backends that bundle ASR)", "name": "language", "in": "formData" }, { "type": "boolean", "description": "export portable biometric profiles (voice-recognition permission; JSON formats only)", "name": "include_speaker_profiles", "in": "formData" }, { "type": "boolean", "description": "include per-segment transcript when the backend supports it", "name": "include_text", "in": "formData" }, { "type": "boolean", "description": "include closed sound events (start, end, label, confidence) when the model has a sound_model companion; otherwise 501 include_sounds_unsupported (JSON formats only)", "name": "include_sounds", "in": "formData" }, { "type": "string", "description": "json (default), verbose_json, or rttm", "name": "response_format", "in": "formData" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/schema.DiarizationResult" } } } } }, "/v1/audio/speech": { "post": { "consumes": [ "application/json" ], "produces": [ "audio/x-wav" ], "tags": [ "audio" ], "summary": "Generates audio from the input text.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.TTSRequest" } } ], "responses": { "200": { "description": "generated audio/wav file", "schema": { "type": "string" } } } } }, "/v1/audio/transcriptions": { "post": { "consumes": [ "multipart/form-data" ], "tags": [ "audio" ], "summary": "Transcribes audio into the input language.", "parameters": [ { "type": "string", "description": "model", "name": "model", "in": "formData", "required": true }, { "type": "file", "description": "file", "name": "file", "in": "formData", "required": true }, { "type": "number", "description": "sampling temperature", "name": "temperature", "in": "formData" }, { "type": "array", "items": { "type": "string" }, "collectionFormat": "csv", "description": "timestamp granularities (word, segment)", "name": "timestamp_granularities", "in": "formData" }, { "type": "boolean", "description": "stream partial results as SSE", "name": "stream", "in": "formData" } ], "responses": { "200": { "description": "Response", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/v1/audio/voices": { "get": { "description": "List named voices and their language and gender metadata. Use the optional model query parameter to filter the response.", "produces": [ "application/json" ], "tags": [ "audio" ], "summary": "List text-to-speech voices", "parameters": [ { "type": "string", "description": "Installed model name", "name": "model", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/localai.TTSVoicesResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/v1/chat/completions": { "post": { "tags": [ "inference" ], "summary": "Generate a chat completions for a given prompt and model.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.OpenAIRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.OpenAIResponse" } } } } }, "/v1/completions": { "post": { "tags": [ "inference" ], "summary": "Generate completions for a given prompt and model.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.OpenAIRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.OpenAIResponse" } } } } }, "/v1/decisions": { "post": { "description": "Uses the same local decision and NER execution as SystemOne. Supports inline images on capable backends; confidence is not OpenAI calibrated.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "systemone" ], "summary": "Answer ordered predicate, choice and score questions.", "parameters": [ { "description": "input + questions + model", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.DecisionsRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/schema.DecisionsResponse" } } } } }, "/v1/depth": { "post": { "tags": [ "depth" ], "summary": "Estimates per-pixel depth (and optionally pose/points) from an image.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.DepthRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.DepthResponse" } } } } }, "/v1/detection": { "post": { "tags": [ "detection" ], "summary": "Detects objects in the input image.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.DetectionRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.DetectionResponse" } } } } }, "/v1/detokenize": { "post": { "tags": [ "tokenize" ], "summary": "Detokenize the input.", "parameters": [ { "description": "Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.DetokenizeRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.DetokenizeResponse" } } } } }, "/v1/edits": { "post": { "tags": [ "inference" ], "summary": "OpenAI edit endpoint", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.OpenAIRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.OpenAIResponse" } } } } }, "/v1/embeddings": { "post": { "tags": [ "embeddings" ], "summary": "Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.OpenAIRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.OpenAIResponse" } } } } }, "/v1/face/analyze": { "post": { "tags": [ "face-recognition" ], "summary": "Analyze demographic attributes (age, gender, ...) of faces.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.FaceAnalyzeRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.FaceAnalyzeResponse" } } } } }, "/v1/face/embed": { "post": { "tags": [ "face-recognition" ], "summary": "Extract a face embedding from an image.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.FaceEmbedRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.FaceEmbedResponse" } } } } }, "/v1/face/forget": { "post": { "tags": [ "face-recognition" ], "summary": "Remove a previously-registered face by ID.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.FaceForgetRequest" } } ], "responses": { "204": { "description": "No Content" } } } }, "/v1/face/identify": { "post": { "tags": [ "face-recognition" ], "summary": "Identify a face against the registered database (1:N recognition).", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.FaceIdentifyRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.FaceIdentifyResponse" } } } } }, "/v1/face/register": { "post": { "tags": [ "face-recognition" ], "summary": "Register a face for 1:N identification.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.FaceRegisterRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.FaceRegisterResponse" } } } } }, "/v1/face/verify": { "post": { "tags": [ "face-recognition" ], "summary": "Verify that two images depict the same person.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.FaceVerifyRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.FaceVerifyResponse" } } } } }, "/v1/forecast": { "post": { "tags": [ "forecast" ], "summary": "Forecasts numeric time series as quantile trajectories.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ForecastRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.ForecastResponse" } } } } }, "/v1/images/generations": { "post": { "tags": [ "images" ], "summary": "Creates an image given a prompt.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.OpenAIRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.OpenAIResponse" } } } } }, "/v1/images/inpainting": { "post": { "description": "Perform image inpainting. Accepts multipart/form-data with ` + "`" + `image` + "`" + ` and ` + "`" + `mask` + "`" + ` files.", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "images" ], "summary": "Image inpainting", "parameters": [ { "type": "string", "description": "Model identifier", "name": "model", "in": "formData", "required": true }, { "type": "string", "description": "Text prompt guiding the generation", "name": "prompt", "in": "formData", "required": true }, { "type": "integer", "description": "Number of inference steps (default 25)", "name": "steps", "in": "formData" }, { "type": "file", "description": "Original image file", "name": "image", "in": "formData", "required": true }, { "type": "file", "description": "Mask image file (white = area to inpaint)", "name": "mask", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/schema.OpenAIResponse" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/v1/images/upscale": { "post": { "description": "Upscale an image using a specified model (e.g. stable-diffusion-x4-upscaler). Accepts multipart/form-data.", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "images" ], "summary": "Image upscaling", "parameters": [ { "type": "string", "description": "Upscaler model identifier (e.g. stable-diffusion-x4-upscaler)", "name": "model", "in": "formData", "required": true }, { "type": "file", "description": "Input image file", "name": "image", "in": "formData", "required": true }, { "type": "integer", "description": "Upscale factor: integer from 1 to 16; must match the model native scale", "name": "scale", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/schema.OpenAIResponse" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/v1/mcp/chat/completions": { "post": { "tags": [ "mcp" ], "summary": "MCP chat completions with automatic tool execution", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.OpenAIRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.OpenAIResponse" } } } } }, "/v1/messages": { "post": { "tags": [ "inference" ], "summary": "Generate a message response for the given messages and model.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.AnthropicRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.AnthropicResponse" } } } } }, "/v1/models": { "get": { "tags": [ "models" ], "summary": "List and describe the various models available in the API.", "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.ModelsDataResponse" } } } } }, "/v1/models/capabilities": { "get": { "tags": [ "models" ], "summary": "List available models enriched with capabilities and input/output modalities.", "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.ModelCapabilitiesResponse" } } } } }, "/v1/moderations": { "post": { "tags": [ "moderation" ], "summary": "Classify text for potentially harmful content.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ModerationRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.ModerationResponse" } } } } }, "/v1/rerank": { "post": { "tags": [ "rerank" ], "summary": "Reranks a list of phrases by relevance to a given text query.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.JINARerankRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.JINARerankResponse" } } } } }, "/v1/responses": { "post": { "tags": [ "inference" ], "summary": "Create a response using the Open Responses API", "parameters": [ { "description": "Request body", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.OpenResponsesRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.ORResponseResource" } } } } }, "/v1/responses/{id}": { "get": { "description": "Retrieve a response by ID. Can be used for polling background responses or resuming streaming responses.", "tags": [ "inference" ], "summary": "Get a response by ID", "parameters": [ { "type": "string", "description": "Response ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Set to 'true' to resume streaming", "name": "stream", "in": "query" }, { "type": "integer", "description": "Sequence number to resume from (for streaming)", "name": "starting_after", "in": "query" } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.ORResponseResource" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": true } } } } }, "/v1/responses/{id}/cancel": { "post": { "description": "Cancel a background response if it's still in progress", "tags": [ "inference" ], "summary": "Cancel a response", "parameters": [ { "type": "string", "description": "Response ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.ORResponseResource" } }, "400": { "description": "Bad Request", "schema": { "type": "object", "additionalProperties": true } }, "404": { "description": "Not Found", "schema": { "type": "object", "additionalProperties": true } } } } }, "/v1/slots/restore": { "post": { "description": "Loads the prompt cache that a save call returned an ID for into one slot of a llama-cpp model. The ID must have been issued for this model. The state is only as fresh as the save. Admin only.", "tags": [ "inference" ], "summary": "Restore a slot's prompt cache by ID.", "parameters": [ { "description": "Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.SlotCacheRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.SlotCacheResponse" } } } } }, "/v1/slots/save": { "post": { "description": "Writes the prompt cache (KV state) of one slot of a llama-cpp model under the directory set by the model's slot_save_path option, and returns an ID for it. The server issues the ID; the client cannot choose a name or a path. The server keeps at most 32 saves per model and deletes the oldest one beyond that. Admin only.", "tags": [ "inference" ], "summary": "Save a slot's prompt cache.", "parameters": [ { "description": "Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.SlotCacheRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.SlotCacheResponse" } } } } }, "/v1/sound-generation": { "post": { "tags": [ "audio" ], "summary": "Generates audio from the input text.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ElevenLabsSoundGenerationRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "type": "string" } } } } }, "/v1/systemone": { "post": { "description": "Runs zero-shot NER over the supplied state and answers each question. Question types: noul (binary entity presence), choice (pick one option), score (pick one level).", "tags": [ "systemone" ], "summary": "Answer structured-extraction questions over state text.", "parameters": [ { "description": "state + questions", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.SystemOneRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/schema.SystemOneResponse" } } } } }, "/v1/systemone/permute": { "post": { "description": "Re-runs one choice question under n_perm option orders. Reports per-order probabilities, argmax stability, and spread.", "tags": [ "systemone" ], "summary": "Re-run a choice question under multiple option orders.", "parameters": [ { "description": "request + question + n_perm + seed", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.SystemOnePermuteRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/schema.SystemOnePermuteResponse" } } } } }, "/v1/systemone/separate": { "post": { "description": "Runs N independent NER passes, one per question, against the same state. Response shape matches /v1/systemone.", "tags": [ "systemone" ], "summary": "Answer each question in a separate NER pass.", "parameters": [ { "description": "state + questions", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.SystemOneRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/schema.SystemOneResponse" } } } } }, "/v1/text-to-speech/{voice-id}": { "post": { "tags": [ "audio" ], "summary": "Generates audio from the input text.", "parameters": [ { "type": "string", "description": "Account ID", "name": "voice-id", "in": "path", "required": true }, { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.TTSRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "type": "string" } } } } }, "/v1/tokenMetrics": { "get": { "consumes": [ "application/json" ], "produces": [ "audio/x-wav" ], "tags": [ "tokenize" ], "summary": "Get TokenMetrics for Active Slot.", "responses": { "200": { "description": "generated audio/wav file", "schema": { "type": "string" } } } } }, "/v1/tokenize": { "post": { "tags": [ "tokenize" ], "summary": "Tokenize the input.", "parameters": [ { "description": "Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.TokenizeRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.TokenizeResponse" } } } } }, "/v1/voice/analyze": { "post": { "tags": [ "voice-recognition" ], "summary": "Analyze demographic attributes (age, gender, emotion) from a voice clip.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.VoiceAnalyzeRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.VoiceAnalyzeResponse" } } } } }, "/v1/voice/embed": { "post": { "tags": [ "voice-recognition" ], "summary": "Extract a speaker embedding from an audio clip.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.VoiceEmbedRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.VoiceEmbedResponse" } } } } }, "/v1/voice/forget": { "post": { "tags": [ "voice-recognition" ], "summary": "Remove a previously-registered speaker by ID.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.VoiceForgetRequest" } } ], "responses": { "204": { "description": "No Content" } } } }, "/v1/voice/identify": { "post": { "tags": [ "voice-recognition" ], "summary": "Identify a speaker against the registered database (1:N recognition).", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.VoiceIdentifyRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.VoiceIdentifyResponse" } } } } }, "/v1/voice/register": { "post": { "description": "Supply either audio or speaker_profiles plus an explicit numeric speaker_slot. The selected model must expose matching trusted encoder metadata for portable enrollment. Registrations are global and ephemeral, with a fresh ID for each request.", "tags": [ "voice-recognition" ], "summary": "Register a speaker for 1:N identification.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.VoiceRegisterRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.VoiceRegisterResponse" } } } } }, "/v1/voice/verify": { "post": { "tags": [ "voice-recognition" ], "summary": "Verify that two audio clips were spoken by the same person.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.VoiceVerifyRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.VoiceVerifyResponse" } } } } }, "/vad": { "post": { "consumes": [ "application/json" ], "tags": [ "audio" ], "summary": "Detect voice fragments in an audio stream", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.VADRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/proto.VADResponse" } } } } }, "/video": { "post": { "tags": [ "video" ], "summary": "Creates a video from a prompt and optional image or audio conditioning.", "parameters": [ { "description": "query params", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.VideoRequest" } } ], "responses": { "200": { "description": "Response", "schema": { "$ref": "#/definitions/schema.OpenAIResponse" } } } } }, "/ws/backend-logs/{modelId}": { "get": { "description": "Opens a WebSocket connection for real-time backend log streaming. Sends an initial batch of existing lines (type \"initial\"), then streams new lines as they appear (type \"line\"). Supports ping/pong keepalive.", "tags": [ "monitoring" ], "summary": "Stream backend logs via WebSocket", "parameters": [ { "type": "string", "description": "Model ID", "name": "modelId", "in": "path", "required": true } ], "responses": {} } } }, "definitions": { "addons.AddonError": { "type": "object", "properties": { "blockedBy": { "description": "BlockedBy is the unresolved operation that blocks the write. It is\npresent only with type outcome_blocked, and only for the owner role of\nthe resource.", "type": "string" }, "code": { "description": "Code repeats the HTTP status. It is absent from outcome_unknown responses.", "type": "integer" }, "message": { "description": "Message describes the failure and never carries owner details.", "type": "string" }, "operationId": { "description": "OperationID is the original operation, which is the proposal ID for a\nproposal call. It is present only with type outcome_unknown or\nproposal_unavailable.", "type": "string" }, "type": { "description": "Type is addon_error, outcome_unknown when a mutation may have run,\nproposal_unavailable when a proposal call could not be served and the\nsame call can be repeated by the same proposal ID after reading it, or\noutcome_blocked (403) when another operation on the resource has an\nunresolved outcome and the caller is the resource's owner role. The\nresource management routes add sharing_disabled (409, local-owner mode\nhas no named users to share with), stale (409, the generation or the\nrevision the caller saw is out of date), operation_conflict (409, the\noperation ID was used for another request and nothing was applied),\ninvalid_request (400, for\nexample a missing deletion confirmation or an unsupported operation),\nquota_reached (403) and not_selected (404, no resource is selected for\nthe conversation). The undo of a change says why it was refused in\nthe type: stale (409, with the words of what changed), not_found (404),\nexpired (410), already_undone (409) or cannot_undo (409).", "type": "string", "example": "outcome_unknown" } } }, "addons.AddonErrorResponse": { "type": "object", "properties": { "error": { "$ref": "#/definitions/addons.AddonError" } } }, "addons.ConfirmRequest": { "type": "object", "properties": { "digest": { "description": "Digest is the digest of the proposal as it was displayed.", "type": "string" } } }, "addons.RecoveryBackupRequest": { "type": "object", "properties": { "operationId": { "description": "OperationID identifies the request. Repeating it returns the backup it\nmade and makes no second one.", "type": "string" } } }, "addons.RecoveryDeleteBackupRequest": { "type": "object", "properties": { "backupId": { "type": "string" }, "operationId": { "type": "string" } } }, "addons.RecoveryDeleted": { "type": "object", "properties": { "deleted": { "type": "string" } } }, "addons.RecoveryPruneRequest": { "type": "object", "properties": { "operationId": { "type": "string" } } }, "addons.RecoveryPruned": { "type": "object", "properties": { "removed": { "type": "array", "items": { "type": "string" } } } }, "addons.RecoveryPurgeRequest": { "type": "object", "properties": { "confirm": { "description": "Confirm is the add-on's ID, typed.", "type": "string" }, "operationId": { "type": "string" }, "scope": { "$ref": "#/definitions/recovery.PurgeScope" } } }, "addons.RecoveryRestoreRequest": { "type": "object", "properties": { "backupId": { "type": "string" }, "confirm": { "description": "Confirm is the add-on's ID, typed.", "type": "string" }, "mapping": { "description": "Mapping names the current account that takes the data of a backup made\nin another ownership mode, as {\"local-owner\": \"\u003caccount id\u003e\"}. It is\nexplicit: there is no wildcard and no default.", "type": "object", "additionalProperties": { "type": "string" } }, "operationId": { "type": "string" } } }, "addons.RecoveryVerifyRequest": { "type": "object", "properties": { "backupId": { "type": "string" }, "operationId": { "type": "string" } } }, "addons.ResolveRequest": { "type": "object", "properties": { "digest": { "description": "Digest is the digest of the proposal as it was displayed.", "type": "string" }, "reason": { "description": "Reason is why the owner stops waiting. Required, at most 512 characters.", "type": "string" } } }, "addons.UpdateCheckRequest": { "type": "object", "properties": { "operationId": { "description": "OperationID identifies the request and is the confirmation header.", "type": "string", "example": "check-notes-1" } } }, "addons.UpgradeRequest": { "type": "object", "properties": { "candidateDigest": { "description": "CandidateDigest is the digest of the candidate the check resolved.", "type": "string", "example": "sha256:fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210" }, "expectedDigest": { "description": "ExpectedDigest is the digest of the installed package the caller saw.", "type": "string", "example": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" }, "generation": { "description": "Generation is the installed generation the caller saw, when it knows it.", "type": "integer", "example": 1 }, "operationId": { "description": "OperationID is the identity of the upgrade: repeat it to replay safely\nand, after an outcome_unknown answer, poll operation-status with it. The\nsame transition under another operation ID is refused.", "type": "string", "example": "upgrade-notes-1" } } }, "apps.AdminView": { "type": "object", "properties": { "canStart": { "type": "boolean" }, "canStop": { "type": "boolean" }, "managementUrl": { "description": "ManagementURL opens the management view of the addon.", "type": "string", "example": "/app/addons?manage=notes" } } }, "apps.App": { "type": "object", "properties": { "admin": { "description": "Admin is present only for administrators.", "allOf": [ { "$ref": "#/definitions/apps.AdminView" } ] }, "description": { "type": "string", "example": "Keep notes." }, "descriptions": { "type": "object", "additionalProperties": { "type": "string" } }, "enabled": { "description": "Enabled is the durable desired state. Health is State, a separate\nobservation: an enabled app can be failed.", "type": "boolean" }, "generation": { "description": "Generation is the installed generation. A Start or Stop request must\ncarry the value that was listed; a stale value is denied.", "type": "integer", "example": 3 }, "hasUI": { "description": "HasUI is true when the addon contributes any UI.", "type": "boolean" }, "icon": { "description": "Icon is a same-origin URL of the verified immutable icon of this\ngeneration. It is absent when the manifest declares none.", "type": "string", "example": "/api/addons/apps/notes/icon?generation=3" }, "id": { "description": "ID is the addon identifier and Name its stable machine name. They are\nthe same in version one: the receipt records no separate catalog name.", "type": "string", "example": "notes" }, "installedAt": { "description": "InstalledAt is when the add-on was first installed, RFC 3339 in UTC. It\nis absent for an add-on installed before the host kept the time. The\noldest install is the default provider of a tool or skill name that\nseveral add-ons replace.", "type": "string", "example": "2026-10-30T09:15:00Z" }, "launchMode": { "type": "string", "example": "always" }, "mainPage": { "description": "MainPage is the path the Open action navigates to. It is present only\nfor an enabled addon whose manifest declares a main page that is one of\nits pages.", "type": "string", "example": "/app/addons/notes/home" }, "name": { "type": "string", "example": "notes" }, "shadows": { "description": "Shadows lists the built-in chat tools the add-on replaces (bash, say).", "type": "array", "items": { "type": "string" } }, "skillShadows": { "description": "SkillShadows lists the built-in skills the add-on replaces (xlsx, say).", "type": "array", "items": { "type": "string" } }, "skills": { "description": "Skills are the skills the package ships, from the verified manifest.\nThe owner copies their files into the chats' skill layer.", "type": "array", "items": { "$ref": "#/definitions/contract.SkillDefinition" } }, "state": { "description": "State is running, starting, failed or stopped: the observation of the\nprocess, never an update.", "type": "string", "enum": [ "running", "starting", "failed", "stopped" ], "example": "running" }, "title": { "description": "Title and Description are the default-language text of the manifest.\nTitles and Descriptions carry every language when the manifest\nlocalizes the text, keyed by BCP 47 tag; they are absent otherwise.", "type": "string", "example": "Notes" }, "titles": { "type": "object", "additionalProperties": { "type": "string" } }, "toolCount": { "type": "integer" }, "toolDefinitions": { "description": "ToolDefinitions are the model-facing definitions the manifest declares:\nthe argument schema and the kind of each tool. The host serves them to\nchat from the verified manifest; the add-on process is never asked.", "type": "array", "items": { "$ref": "#/definitions/contract.ToolDefinition" } }, "tools": { "description": "Tools are the tool names of the manifest, at most 32. ToolCount is the\nfull number. The manifest carries no tool descriptions.", "type": "array", "items": { "type": "string" } }, "ui": { "description": "UI describes what the shell loads for this app. It is present only for\nan enabled addon with a UI whose installed package has a sha256 digest.", "allOf": [ { "$ref": "#/definitions/apps.UIView" } ] }, "update": { "description": "Update is update-pending when the owner's cached update check says an\nupdate is available for the installed package. It is a separate\nobservation from State and is absent otherwise: an unchecked, failed\nor up to date add-on has none. The list never reaches a library.", "type": "string", "enum": [ "update-pending" ], "example": "update-pending" }, "version": { "type": "string", "example": "1.2.3" } } }, "apps.ChatActionView": { "type": "object", "properties": { "component": { "type": "string", "example": "SummaryPanel" }, "icon": { "description": "Icon is a host icon name, or the empty string when the action uses the\npackaged icon of the app (see the icon of the app).", "type": "string", "example": "sparkles" }, "id": { "description": "ID is the manifest identifier of the action.", "type": "string", "example": "summarize" }, "label": { "description": "Label is the default-language text; Labels carries every language when\nthe manifest localizes it.", "type": "string", "example": "Summarize" }, "labels": { "type": "object", "additionalProperties": { "type": "string" } }, "packagedIcon": { "description": "PackagedIcon is true when the action draws the packaged app icon.", "type": "boolean" }, "placement": { "description": "Placement is composer or message.", "type": "string", "enum": [ "composer", "message" ], "example": "composer" }, "tool": { "description": "Tool is the own tool the action calls, or Component the exported\ncomponent it opens. Exactly one is set.", "type": "string", "example": "summarize" } } }, "apps.List": { "type": "object", "properties": { "apps": { "type": "array", "items": { "$ref": "#/definitions/apps.App" } } } }, "apps.SlotView": { "type": "object", "properties": { "component": { "type": "string", "example": "NotesSettings" }, "extensions": { "description": "Extensions are set for a files.preview slot: the file extensions it handles.", "type": "array", "items": { "type": "string" }, "example": [ "docx", "xlsx" ] }, "id": { "type": "string", "example": "notes-nav" }, "slot": { "type": "string", "enum": [ "chat.composer.actions", "chat.message.actions", "app.nav", "settings.sections", "files.preview" ], "example": "settings.sections" } } }, "apps.StartRequest": { "type": "object", "properties": { "generation": { "description": "Generation is the installed generation the caller saw in the list.", "type": "integer", "example": 3 }, "operationId": { "description": "OperationID names the lifecycle operation. Repeating it never runs the\nchange twice and, after an outcome_unknown answer, it is the identifier\nto poll.", "type": "string", "example": "start-notes-1" } } }, "apps.UIView": { "type": "object", "properties": { "actions": { "description": "Actions are the chat actions that declare a placement and a target.\nSlots and Renderers are the other declared contributions. The manifest\nwas validated at install: every tool named here is a tool of the addon,\nevery slot is a host slot and every icon is a host icon name or the\npackaged icon. The host draws them only while the addon is enabled and\nusable by the caller.", "type": "array", "items": { "$ref": "#/definitions/apps.ChatActionView" } }, "chatActions": { "type": "array", "items": { "type": "string" } }, "controls": { "description": "Controls are the host controls the host draws for the addon: the ones\nits manifest declares that its grants and tools entitle it to now. The\nhost draws them with its own components; the addon supplies nothing.", "type": "array", "items": { "type": "string", "enum": [ "network-policy", "tool-providers" ] }, "example": [ "network-policy" ] }, "css": { "description": "CSS are the URLs of the declared style sheets.", "type": "array", "items": { "type": "string" } }, "entry": { "description": "Entry is the URL of the packaged ES module. Every asset URL names the\npackage digest, so a new package is a new URL.", "type": "string", "example": "/api/addons/notes/assets/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef/ui.js" }, "navigation": { "type": "array", "items": { "type": "string" } }, "pages": { "description": "Pages, Navigation and ChatActions are the identifiers the manifest\ndeclares. The host decides where each one is shown.", "type": "array", "items": { "type": "string" } }, "renderers": { "type": "array", "items": { "$ref": "#/definitions/contract.Renderer" } }, "sdk": { "description": "SDK is the range of host SDK versions the module accepts.", "allOf": [ { "$ref": "#/definitions/contract.VersionRange" } ] }, "slots": { "type": "array", "items": { "$ref": "#/definitions/apps.SlotView" } } } }, "auth.WebSocketTicketResponse": { "type": "object", "properties": { "expires_at": { "type": "string" }, "ticket": { "type": "string" } } }, "backendlib.Update": { "type": "object", "properties": { "digest": { "type": "string" }, "installedDigest": { "type": "string" }, "installedVersion": { "description": "InstalledVersion and InstalledDigest are what metadata.json pins.", "type": "string" }, "name": { "description": "Name is the backend name.", "type": "string" }, "signed": { "description": "Signed says the library requires a signature, so the install of the\nupdate has a verifying step.", "type": "boolean" }, "sourceId": { "description": "SourceID is the library the backend came from.", "type": "string" }, "version": { "description": "Version and Digest are the build the library lists now. Version is what\nan install of the update names.", "type": "string" } } }, "builtin.Entry": { "type": "object", "properties": { "adminOnly": { "type": "boolean" }, "feature": { "type": "string" }, "icon": { "type": "string" }, "id": { "type": "string" }, "kind": { "$ref": "#/definitions/builtin.Kind" }, "mainPath": { "type": "string" }, "titleKey": { "type": "string" } } }, "builtin.Kind": { "type": "string", "enum": [ "page" ], "x-enum-varnames": [ "KindPage" ] }, "catalog.Kind": { "type": "string", "enum": [ "addon", "backend", "model", "all" ], "x-enum-varnames": [ "KindAddon", "KindBackend", "KindModel", "QueryAllKinds" ] }, "catalog.RefreshState": { "type": "object", "properties": { "checkedAt": { "type": "string" }, "count": { "type": "integer" }, "failed": { "description": "Failed is true when the latest fetch failed; the previous releases are\nnot served in that case.", "type": "boolean" }, "lastSuccess": { "type": "string" }, "skipped": { "description": "Skipped and SkippedKinds are as in RefreshResult.", "type": "integer" }, "skippedKinds": { "type": "array", "items": { "type": "string" } } } }, "catalog.VerificationPolicy": { "type": "object", "properties": { "identity": { "type": "string" }, "identityRegex": { "description": "IdentityRegex is an anchored pattern for the signer identity, used\ninstead of Identity so that master and tagged builds both verify. Only a\nlibrary that serves backends may use it; an add-on install refuses it.", "type": "string" }, "issuer": { "type": "string" }, "requireSignature": { "type": "boolean" } } }, "config.Gallery": { "type": "object", "properties": { "artifact_verification": { "description": "ArtifactVerification overrides Verification only for the gallery OCI artifact.\nBackend images keep their separate Verification policy.", "allOf": [ { "$ref": "#/definitions/config.GalleryVerification" } ] }, "library": { "description": "Library says the URL is a model library (the shared library entry\nshape), not a gallery index.", "type": "boolean" }, "mirrors": { "description": "Mirrors are tried in order when URL cannot be fetched. They are a\nfallback for availability, not a load-balancing pool: the primary is\nalways preferred, and a mirror is only consulted after the one before\nit fails. Any URI the gallery loader understands works here\n(https://, github:, file://, oci://).", "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "url": { "type": "string" }, "verification": { "$ref": "#/definitions/config.GalleryVerification" } } }, "config.GalleryVerification": { "type": "object", "properties": { "identity": { "type": "string" }, "identity_regex": { "type": "string" }, "issuer": { "type": "string" }, "issuer_regex": { "type": "string" }, "not_before": { "description": "NotBefore is an RFC3339 timestamp. Empty disables the time check.", "type": "string" }, "source_repository": { "description": "SourceRepository is an https URL compared exactly against the\ncertificate's source-repository extension. Empty skips the check.", "type": "string" } } }, "config.TTSVoice": { "type": "object", "properties": { "gender": { "type": "string" }, "language": { "type": "string" }, "name": { "type": "string" } } }, "contract.OutputDescription": { "type": "object", "properties": { "handle": { "type": "string" }, "mediaType": { "type": "string" }, "name": { "type": "string" }, "size": { "type": "integer" } } }, "contract.Receipt": { "type": "object", "properties": { "operationId": { "type": "string" }, "result": { "$ref": "#/definitions/contract.Result" }, "revision": { "$ref": "#/definitions/contract.Revision" }, "state": { "$ref": "#/definitions/contract.ReceiptState" } } }, "contract.ReceiptState": { "type": "string", "enum": [ "pending", "committed", "rejected", "unknown" ], "x-enum-varnames": [ "ReceiptPending", "ReceiptCommitted", "ReceiptRejected", "ReceiptUnknown" ] }, "contract.Renderer": { "type": "object", "properties": { "component": { "type": "string" }, "kind": { "type": "string" }, "tool": { "type": "string" } } }, "contract.Request": { "type": "object", "properties": { "action": { "type": "string" }, "addonId": { "type": "string" }, "arguments": { "type": "object" }, "generation": { "type": "integer" }, "operationId": { "type": "string" }, "resourceId": { "type": "string" } } }, "contract.Result": { "type": "object", "properties": { "outputs": { "type": "array", "items": { "$ref": "#/definitions/contract.OutputDescription" } }, "payload": { "type": "object" } } }, "contract.Revision": { "type": "object", "properties": { "data": { "type": "integer" }, "schema": { "type": "integer" } } }, "contract.SkillDefinition": { "type": "object", "properties": { "name": { "description": "Name is the skill's name and the name of its folder. A plain skill is\nnamed after the add-on: the add-on ID, or the ID and a dash and more\n(office-quickstart), so two add-ons never ship one plain name. A skill\nthat replaces a built-in one has the built-in's name (see Shadows).", "type": "string" }, "shadows": { "description": "Shadows names the built-in skill this skill replaces. It must equal Name\nand be one of ReplaceableSkills. It repeats the name on purpose: the\nreplacement is an explicit act, which the install warning and the check\nread from the manifest without opening the package. Empty: a plain\nadd-on skill.", "type": "string" } } }, "contract.ToolDefinition": { "type": "object", "properties": { "description": { "description": "Description is plain text for the model.", "type": "string" }, "inputSchema": { "description": "InputSchema is the JSON schema of the arguments object. It is an\nobject schema with explicit properties, additionalProperties false at\nthe top level and the keywords the host allows only.", "type": "object" }, "kind": { "description": "Kind is read, write, schema or create.", "type": "string" }, "name": { "description": "Name is one of capabilities.tools.", "type": "string" }, "shadows": { "description": "Shadows names a built-in chat tool that this tool replaces. When the\nadd-on is installed, running and on for a chat, the model sees one tool\nunder that name, served by the add-on, and the built-in one is hidden.\nOnly a name in ReplaceableTools may be shadowed. A tool without it keeps\nits add-on name (addon__\u003cid\u003e__\u003ctool\u003e).", "type": "string" }, "uiOnly": { "description": "UIOnly marks a tool that only the add-on's own page may call, such as a\nsettings change that asks the host whether the caller is an\nadministrator. It is never offered to a model, a chat or an agent. The\npage has no resource to name, so it must be a read tool without one.", "type": "boolean" } } }, "contract.VersionRange": { "type": "object", "properties": { "max": { "type": "integer" }, "min": { "type": "integer" } } }, "failover.ChainState": { "type": "string", "enum": [ "primary", "fallback", "degraded" ], "x-enum-varnames": [ "ChainPrimary", "ChainFallback", "ChainDegraded" ] }, "failover.ChainStatus": { "type": "object", "properties": { "active": { "type": "string" }, "active_since": { "type": "string" }, "name": { "type": "string" }, "pinned": { "type": "string" }, "state": { "$ref": "#/definitions/failover.ChainState" }, "targets": { "type": "array", "items": { "$ref": "#/definitions/failover.TargetStatus" } } } }, "failover.Kind": { "type": "string", "enum": [ "local", "remote" ], "x-enum-varnames": [ "KindLocal", "KindRemote" ] }, "failover.TargetState": { "type": "string", "enum": [ "healthy", "down", "recovering", "missing" ], "x-enum-varnames": [ "StateHealthy", "StateDown", "StateRecovering", "StateMissing" ] }, "failover.TargetStatus": { "type": "object", "properties": { "consecutive_ok": { "type": "integer" }, "kind": { "$ref": "#/definitions/failover.Kind" }, "last_error": { "type": "string" }, "last_probe": { "type": "string" }, "model": { "type": "string" }, "state": { "$ref": "#/definitions/failover.TargetState" }, "warm": { "type": "boolean" } } }, "functions.Function": { "type": "object", "properties": { "description": { "type": "string" }, "name": { "type": "string" }, "parameters": { "type": "object", "additionalProperties": {} }, "strict": { "type": "boolean" } } }, "functions.Item": { "type": "object", "properties": { "properties": { "type": "object", "additionalProperties": {} }, "type": { "type": "string" } } }, "functions.JSONFunctionStructure": { "type": "object", "properties": { "$defs": { "type": "object", "additionalProperties": {} }, "anyOf": { "type": "array", "items": { "$ref": "#/definitions/functions.Item" } }, "oneOf": { "type": "array", "items": { "$ref": "#/definitions/functions.Item" } } } }, "functions.Tool": { "type": "object", "properties": { "function": { "$ref": "#/definitions/functions.Function" }, "type": { "type": "string" } } }, "gallery.File": { "type": "object", "properties": { "filename": { "type": "string" }, "sha256": { "type": "string" }, "uri": { "type": "string" } } }, "gallery.GalleryBackend": { "type": "object", "properties": { "alias": { "type": "string" }, "backend": { "description": "Backend is the resolved backend engine for this model (e.g. \"llama-cpp\").\nPopulated at load time from overrides, inline config, or the URL-referenced config file.", "type": "string" }, "capabilities": { "type": "object", "additionalProperties": { "type": "string" } }, "description": { "type": "string" }, "files": { "description": "AdditionalFiles are used to add additional files to the model", "type": "array", "items": { "$ref": "#/definitions/gallery.File" } }, "gallery": { "description": "Gallery is a reference to the gallery which contains the model", "allOf": [ { "$ref": "#/definitions/config.Gallery" } ] }, "icon": { "type": "string" }, "installed": { "description": "Installed is used to indicate if the model is installed or not", "type": "boolean" }, "license": { "type": "string" }, "mirrors": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "sha256": { "description": "SHA256 is the expected sha256 of the backend tarball at URI / Mirrors.\nEmpty disables the integrity check; OCI URIs carry their own digest.", "type": "string" }, "size": { "description": "Size is an optional hardcoded model size string (e.g. \"500MB\", \"14.5GB\").\nUsed when the size cannot be estimated automatically.", "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "uri": { "type": "string" }, "url": { "type": "string" }, "urls": { "type": "array", "items": { "type": "string" } }, "version": { "type": "string" } } }, "gallery.Metadata": { "type": "object", "properties": { "backend": { "description": "Backend is the resolved backend engine for this model (e.g. \"llama-cpp\").\nPopulated at load time from overrides, inline config, or the URL-referenced config file.", "type": "string" }, "description": { "type": "string" }, "files": { "description": "AdditionalFiles are used to add additional files to the model", "type": "array", "items": { "$ref": "#/definitions/gallery.File" } }, "gallery": { "description": "Gallery is a reference to the gallery which contains the model", "allOf": [ { "$ref": "#/definitions/config.Gallery" } ] }, "icon": { "type": "string" }, "installed": { "description": "Installed is used to indicate if the model is installed or not", "type": "boolean" }, "license": { "type": "string" }, "name": { "type": "string" }, "size": { "description": "Size is an optional hardcoded model size string (e.g. \"500MB\", \"14.5GB\").\nUsed when the size cannot be estimated automatically.", "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "url": { "type": "string" }, "urls": { "type": "array", "items": { "type": "string" } } } }, "gallery.ModelStorage": { "type": "object", "properties": { "files": { "type": "array", "items": { "type": "string" } }, "missing": { "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "shared_bytes": { "type": "integer" }, "size_bytes": { "type": "integer" } } }, "gallery.NodeDriftInfo": { "type": "object", "properties": { "digest": { "type": "string" }, "node_id": { "type": "string" }, "node_name": { "type": "string" }, "version": { "type": "string" } } }, "gallery.StorageFile": { "type": "object", "properties": { "missing": { "type": "boolean" }, "models": { "type": "array", "items": { "type": "string" } }, "path": { "description": "Path is relative to the models directory.", "type": "string" }, "size_bytes": { "type": "integer" } } }, "gallery.StorageIndex": { "type": "object", "properties": { "errors": { "description": "Errors carries per-config failures (malformed YAML, path escapes),\nreported rather than fatal so one broken config cannot blank the\nwhole report.", "type": "array", "items": { "type": "string" } }, "files": { "type": "array", "items": { "$ref": "#/definitions/gallery.StorageFile" } }, "models": { "type": "array", "items": { "$ref": "#/definitions/gallery.ModelStorage" } }, "total_bytes": { "type": "integer" } } }, "gallery.UpgradeInfo": { "type": "object", "properties": { "available_digest": { "type": "string" }, "available_version": { "type": "string" }, "backend_name": { "type": "string" }, "installed_digest": { "type": "string" }, "installed_version": { "type": "string" }, "node_drift": { "description": "NodeDrift lists nodes whose installed version or digest differs from\nthe cluster majority. Non-empty means the cluster has diverged and an\nupgrade will realign it. Empty in single-node mode.", "type": "array", "items": { "$ref": "#/definitions/gallery.NodeDriftInfo" } }, "reason": { "description": "Reason says why the backend is flagged when version and digest alone\nwould not flag it: the backend failed a request in a way that shows it\nis older than the server. Empty for ordinary version or digest upgrades.", "type": "string" } } }, "gallery.Variant": { "type": "object", "properties": { "model": { "description": "Model is the name of a gallery entry that declares no variants of its own.", "type": "string" } } }, "galleryop.NodeProgress": { "type": "object", "properties": { "current": { "type": "string" }, "error": { "type": "string" }, "file_name": { "type": "string" }, "node_id": { "type": "string" }, "node_name": { "type": "string" }, "percentage": { "type": "number" }, "phase": { "type": "string" }, "status": { "type": "string" }, "total": { "type": "string" } } }, "galleryop.OpStatus": { "type": "object", "properties": { "cancellable": { "description": "Cancellable is true if the operation can be cancelled", "type": "boolean" }, "cancelled": { "description": "Cancelled is true if the operation was cancelled", "type": "boolean" }, "current_bytes": { "type": "integer" }, "deletion": { "description": "Deletion is true if the operation is a deletion", "type": "boolean" }, "downloaded_size": { "type": "string" }, "file_name": { "type": "string" }, "file_size": { "type": "string" }, "gallery_element_name": { "type": "string" }, "message": { "type": "string" }, "nodes": { "description": "Nodes is the per-node breakdown for a fanned-out backend install.\nPopulated by DistributedBackendManager (per-node terminal status)\nand by the Phase 2 progress bridge (per-byte ticks). The\n/api/operations handler surfaces this so the UI can render an\nexpandable per-node view of an in-flight install.", "type": "array", "items": { "$ref": "#/definitions/galleryop.NodeProgress" } }, "phase": { "type": "string" }, "processed": { "type": "boolean" }, "progress": { "type": "number" }, "total_bytes": { "type": "integer" } } }, "gateway.ApplyResourceRequest": { "type": "object", "properties": { "arguments": { "description": "Arguments are the tool's own arguments without the resource, which the\npath names, and without the tool, which Tool names.", "type": "object" }, "generation": { "description": "Generation is the installed generation the caller listed.", "type": "integer", "example": 3 }, "operationId": { "description": "OperationID names the change. Repeating it with the same request\nreturns the same receipt and never applies twice; after an\noutcome_unknown answer it is what to repeat.", "type": "string", "example": "apply-1" }, "revision": { "description": "Revision is the revision the caller read. A moved revision is a stale\ndenial and nothing is changed.", "allOf": [ { "$ref": "#/definitions/contract.Revision" } ] }, "tool": { "description": "Tool is a write or schema tool the add-on declares.", "type": "string", "example": "rows-insert" } } }, "gateway.ApplyResult": { "type": "object", "properties": { "operationId": { "type": "string" }, "requestHash": { "description": "RequestHash binds the operation ID to the request: the SHA-256 of the\nresource, the tool and the canonical arguments. A lookup of the\noperation reports it, so a client can tell its own request from\nanother one that used the same ID.", "type": "string", "example": "3f786850e387550fdab836ed7e6dc881de23001b3f786850e387550fdab836ed" }, "resourceId": { "type": "string" }, "result": { "description": "Result is what the add-on's receipt reported, for example the count\nand the identifiers of the changed rows.", "type": "object" }, "revision": { "description": "Revision is the revision after the change.", "allOf": [ { "$ref": "#/definitions/contract.Revision" } ] } } }, "gateway.Artifact": { "type": "object", "properties": { "addonId": { "description": "AddonID and Generation name the addon build that produced the result.", "type": "string" }, "createdAt": { "type": "string" }, "expiresAt": { "description": "ExpiresAt is when the artifact stops being served and is removed.", "type": "string" }, "generation": { "type": "integer" }, "id": { "description": "ID is the host-generated opaque identifier. It is the only handle a\nclient ever holds for the file.", "type": "string" }, "mediaType": { "type": "string" }, "name": { "description": "Name is the sanitized attachment name and MediaType the safe media type\nthe download is served with.", "type": "string" }, "operationId": { "description": "OperationID is the operation of the request that produced the output.", "type": "string" }, "principal": { "description": "Principal is the user who requested the result. Only this user can read\nor download the artifact.", "type": "string" }, "reason": { "description": "Reason says why a transfer failed or was cancelled. It never carries\naddon text.", "type": "string" }, "size": { "description": "Size is the exact number of bytes of a complete artifact.", "type": "integer" }, "sources": { "description": "Sources are the resources the bytes were produced from. Every one of\nthem must still be readable by the principal at completion and at each\ndownload.", "type": "array", "items": { "$ref": "#/definitions/gateway.ArtifactResource" } }, "state": { "$ref": "#/definitions/gateway.ArtifactState" } } }, "gateway.ArtifactResource": { "type": "object", "properties": { "addonId": { "type": "string" }, "resourceId": { "type": "string" } } }, "gateway.ArtifactState": { "type": "string", "enum": [ "transferring", "complete", "failed", "cancelled" ], "x-enum-varnames": [ "ArtifactTransferring", "ArtifactComplete", "ArtifactFailed", "ArtifactCancelled" ] }, "gateway.BlockingProposal": { "type": "object", "properties": { "action": { "type": "string" }, "addonId": { "type": "string" }, "ageSeconds": { "description": "AgeSeconds is how long the outcome has been unresolved, counted from\nthe hand-over to the addon.", "type": "integer" }, "createdAt": { "type": "string" }, "digest": { "description": "Digest is what the owner names to resolve the proposal.", "type": "string" }, "effects": { "$ref": "#/definitions/gateway.ProposalEffects" }, "expiresAt": { "type": "string" }, "id": { "description": "ID is the proposal identifier, which is its operation identifier.", "type": "string" }, "proposerId": { "description": "ProposerID is the user who proposed the operation.", "type": "string" }, "reason": { "description": "Reason says why the outcome is unresolved.", "type": "string" }, "resolution": { "description": "Resolution is present once the owner stopped waiting.", "allOf": [ { "$ref": "#/definitions/gateway.ProposalResolution" } ] }, "resourceId": { "type": "string" }, "state": { "description": "State is executing, outcome-unknown or abandoned-unknown.", "allOf": [ { "$ref": "#/definitions/gateway.ProposalState" } ] } } }, "gateway.CreateResourceRequest": { "type": "object", "properties": { "addonId": { "description": "AddonID names the add-on whose resource is created.", "type": "string", "example": "tables" }, "arguments": { "description": "Arguments are the create arguments the add-on's create tool takes, for\nexample the name. They are validated against its tool definition.", "type": "object" }, "generation": { "description": "Generation is the installed generation the caller listed.", "type": "integer", "example": 3 }, "operationId": { "description": "OperationID names the creation. Repeating it never creates a second\nresource and, after an outcome_unknown answer, it is what to repeat.", "type": "string", "example": "create-budget-1" } } }, "gateway.DeleteResourceRequest": { "type": "object", "properties": { "confirm": { "description": "Confirm must equal the display name of the resource exactly: the person\ntypes it to confirm. Deletion removes the data and every grant, cannot\nbe undone and is never a chat operation.", "type": "string", "example": "Budget" }, "generation": { "type": "integer", "example": 3 }, "operationId": { "type": "string", "example": "delete-1" }, "revision": { "$ref": "#/definitions/contract.Revision" } } }, "gateway.DeleteResult": { "type": "object", "properties": { "deleted": { "description": "Deleted is true once the add-on confirmed that the data is gone and\nthe grants were removed.", "type": "boolean" }, "resourceId": { "type": "string" } } }, "gateway.Grant": { "type": "object", "properties": { "displayName": { "type": "string", "example": "Bob" }, "role": { "type": "string", "enum": [ "viewer", "editor" ], "example": "viewer" }, "userId": { "description": "UserID is the immutable account identifier of the grantee.", "type": "string", "example": "4f1c" } } }, "gateway.GrantList": { "type": "object", "properties": { "grants": { "type": "array", "items": { "$ref": "#/definitions/gateway.Grant" } }, "resourceId": { "type": "string" } } }, "gateway.OperationStatus": { "type": "object", "properties": { "operationId": { "type": "string" }, "requestHash": { "type": "string", "example": "3f786850e387550fdab836ed7e6dc881de23001b3f786850e387550fdab836ed" }, "state": { "description": "State is pending, committed, rejected or unknown.", "type": "string", "enum": [ "pending", "committed", "rejected", "unknown" ] }, "tool": { "description": "Tool and RequestHash name the request the operation ID was first\nused for, as the host recorded it when it dispatched the change (kind\napply only). They are absent when the host no longer holds the\nrequest, for example after a restart. Compare RequestHash with the\nhash of your own request before you believe a committed state.", "type": "string", "example": "rows-insert" } } }, "gateway.PendingList": { "type": "object", "properties": { "proposals": { "description": "Proposals are the caller's own proposals that still wait for a human\ndecision, newest first. A proposal of another user is never listed.", "type": "array", "items": { "$ref": "#/definitions/gateway.Proposal" } } } }, "gateway.Proposal": { "type": "object", "properties": { "action": { "type": "string" }, "addonId": { "type": "string" }, "arguments": { "description": "Arguments are the canonical stored arguments. They are the only\narguments that can ever be submitted for this proposal.", "type": "object" }, "blocked": { "description": "Blocked reports that another operation on the resource has an\nunresolved outcome, so confirming is denied until it is resolved. The\noperation itself belongs to its proposer and is shown only to the\nresource's owner role, in the unresolved listing and in the denial.", "type": "boolean" }, "createdAt": { "type": "string" }, "digest": { "description": "Digest binds a confirmation to exactly what was shown.", "type": "string" }, "effects": { "$ref": "#/definitions/gateway.ProposalEffects" }, "expiresAt": { "type": "string" }, "generation": { "type": "integer" }, "id": { "description": "ID is the proposal identifier. It is the operation identifier of the\nstored operation, so a lost reply is always resolved by the same ID.", "type": "string" }, "operationId": { "type": "string" }, "reason": { "description": "Reason says why a proposal is cancelled, expired or rejected.", "type": "string" }, "receipt": { "description": "Receipt is present once the runtime answered.", "allOf": [ { "$ref": "#/definitions/contract.Receipt" } ] }, "resolution": { "description": "Resolution is present once the resource owner stopped waiting for an\nunresolved outcome. It stays after a late receipt is recorded.", "allOf": [ { "$ref": "#/definitions/gateway.ProposalResolution" } ] }, "resourceId": { "type": "string" }, "revision": { "description": "Revision is the schema and data revision the preview saw. The runtime\nrefuses the apply when it moved.", "allOf": [ { "$ref": "#/definitions/contract.Revision" } ] }, "state": { "$ref": "#/definitions/gateway.ProposalState" } } }, "gateway.ProposalEffects": { "type": "object", "properties": { "count": { "description": "Count is the exact number of effects the operation would have.", "type": "integer" }, "sample": { "description": "Sample is a bounded excerpt of the effects, or the whole preview summary\nwhen the addon did not separate one.", "type": "object" } } }, "gateway.ProposalList": { "type": "object", "properties": { "proposals": { "type": "array", "items": { "$ref": "#/definitions/gateway.BlockingProposal" } } } }, "gateway.ProposalResolution": { "type": "object", "properties": { "actorId": { "description": "ActorID is the resource owner who acknowledged the unknown outcome.", "type": "string" }, "at": { "description": "At is when the acknowledgement was recorded.", "type": "string" }, "reason": { "description": "Reason is the owner's stated reason.", "type": "string" } } }, "gateway.ProposalState": { "type": "string", "enum": [ "pending", "cancelled", "expired", "executing", "applied", "rejected", "outcome-unknown", "abandoned-unknown" ], "x-enum-varnames": [ "ProposalPending", "ProposalCancelled", "ProposalExpired", "ProposalExecuting", "ProposalApplied", "ProposalRejected", "ProposalOutcomeUnknown", "ProposalAbandoned" ] }, "gateway.RelayRequest": { "type": "object", "properties": { "digest": { "description": "Digest names the installed package an asset belongs to: the lower-case\nhex of its sha256. Only the kind \"asset\" uses it.", "type": "string" }, "handle": { "type": "string" }, "kind": { "type": "string" }, "request": { "$ref": "#/definitions/contract.Request" } } }, "gateway.RenameResourceRequest": { "type": "object", "properties": { "generation": { "type": "integer", "example": 3 }, "name": { "type": "string", "example": "Budget 2027" }, "operationId": { "type": "string", "example": "rename-1" }, "revision": { "description": "Revision is the revision the caller listed. A moved revision is a\nstale denial and nothing is changed.", "allOf": [ { "$ref": "#/definitions/contract.Revision" } ] } } }, "gateway.ResourceInfo": { "type": "object", "properties": { "addonId": { "type": "string", "example": "tables" }, "id": { "description": "ID is the opaque resource identifier.", "type": "string", "example": "r0123456789abcdef0123456789abcde" }, "name": { "description": "Name is the display name the add-on reported. It is empty when the\nadd-on could not answer in time.", "type": "string", "example": "Budget" }, "owner": { "description": "Owner is the display name of the owner, shown to people the resource\nis shared with. It is empty in local-owner mode.", "type": "string", "example": "Alice" }, "revision": { "description": "Revision is the schema and data revision the listing saw. It is\npresent for the owner role and goes back with a rename or a delete.", "allOf": [ { "$ref": "#/definitions/contract.Revision" } ] }, "role": { "description": "Role is the caller's own role: viewer, editor or owner.", "type": "string", "enum": [ "viewer", "editor", "owner" ], "example": "owner" }, "sharedWith": { "description": "SharedWith is the number of people the resource is shared with. It is\npresent for the owner role only.", "type": "integer", "example": 2 } } }, "gateway.ResourceList": { "type": "object", "properties": { "addonId": { "type": "string", "example": "tables" }, "generation": { "description": "Generation is the installed generation the listing saw. Rename, delete\nand create carry it; a stale tab is denied.", "type": "integer", "example": 3 }, "noun": { "description": "Noun is the singular word the add-on uses for its resources.", "type": "string", "example": "database" }, "operations": { "description": "Operations lists the management operations the add-on supports.", "type": "array", "items": { "type": "string", "enum": [ "create", "rename", "delete" ] } }, "resources": { "type": "array", "items": { "$ref": "#/definitions/gateway.ResourceInfo" } }, "sharing": { "description": "Sharing is false in local-owner mode, where nothing can be shared.", "type": "boolean" }, "truncated": { "description": "Truncated says more resources exist than the bound lists.", "type": "boolean" } } }, "gateway.Selection": { "type": "object", "properties": { "addonId": { "type": "string", "example": "tables" }, "conversationId": { "type": "string", "example": "chat-1" }, "name": { "type": "string", "example": "Budget" }, "resourceId": { "type": "string", "example": "r0123456789abcdef0123456789abcde" }, "role": { "type": "string", "enum": [ "viewer", "editor", "owner" ] } } }, "gateway.SelectionRequest": { "type": "object", "properties": { "resourceId": { "description": "ResourceID is the resource to use in the conversation. The caller must\nhold at least the viewer role on it now.", "type": "string", "example": "r0123456789abcdef0123456789abcde" } } }, "gateway.SetGrantRequest": { "type": "object", "properties": { "operationId": { "description": "OperationID is optional. It is returned with outcome_unknown, and the\nchange is safe to repeat.", "type": "string", "example": "grant-1" }, "role": { "description": "Role is viewer or editor. The owner role cannot be granted.", "type": "string", "enum": [ "viewer", "editor" ], "example": "viewer" } } }, "gateway.UndoRequest": { "type": "object", "properties": { "generation": { "description": "Generation is the installed generation the caller listed.", "type": "integer", "example": 3 }, "operationId": { "description": "OperationID names the undo. Repeating it with the same change returns\nthe same result and undoes once; after outcome_unknown it is what to\nrepeat.", "type": "string", "example": "undo-1" } } }, "gateway.UndoResult": { "type": "object", "properties": { "changeId": { "type": "string" }, "deleted": { "description": "Deleted is true when the undo removed the resource itself: the change\nwas its creation.", "type": "boolean" }, "operationId": { "type": "string" }, "resourceId": { "type": "string" }, "revision": { "description": "Revision is the revision after the undo.", "allOf": [ { "$ref": "#/definitions/contract.Revision" } ] }, "summary": { "description": "Summary says in one line what the undo did.", "type": "string" } } }, "gateway.UserList": { "type": "object", "properties": { "users": { "type": "array", "items": { "$ref": "#/definitions/gateway.UserRef" } } } }, "gateway.UserRef": { "type": "object", "properties": { "displayName": { "type": "string", "example": "Bob" }, "id": { "type": "string", "example": "4f1c" } } }, "library.Info": { "type": "object", "properties": { "authReference": { "type": "string" }, "conflict": { "description": "Conflict explains how this source clashes with another one, when it does.", "type": "string" }, "default": { "type": "boolean" }, "enabled": { "description": "Enabled is what the host does with the source: false for a source that\nis turned off, removed, or a shipped default while the official\nlibraries are off. Suspended tells the last case apart.", "type": "boolean" }, "format": { "type": "string" }, "id": { "type": "string" }, "kind": { "$ref": "#/definitions/catalog.Kind" }, "mirrors": { "description": "Mirrors are the fallback addresses of the source, in order.", "type": "array", "items": { "type": "string" } }, "name": { "type": "string" }, "policy": { "$ref": "#/definitions/catalog.VerificationPolicy" }, "refresh": { "$ref": "#/definitions/catalog.RefreshState" }, "removed": { "type": "boolean" }, "suspended": { "type": "boolean" }, "url": { "type": "string" } } }, "localai.APIInstructionResponse": { "type": "object", "properties": { "description": { "type": "string" }, "name": { "type": "string" }, "swagger_fragment": { "type": "object", "additionalProperties": {} }, "tags": { "type": "array", "items": { "type": "string" } } } }, "localai.AliasInfo": { "type": "object", "properties": { "name": { "type": "string" }, "target": { "type": "string" } } }, "localai.BackendLibraryInstallRequest": { "type": "object", "properties": { "name": { "description": "Name is the backend name of the entry.", "type": "string" }, "sourceId": { "description": "SourceID is the library the entry comes from.", "type": "string" }, "version": { "description": "Version is the version or the channel of the entry.", "type": "string" } } }, "localai.BrandingResponse": { "type": "object", "properties": { "favicon_url": { "type": "string" }, "instance_name": { "type": "string" }, "instance_tagline": { "type": "string" }, "logo_horizontal_url": { "type": "string" }, "logo_url": { "type": "string" } } }, "localai.FailoverChainsResponse": { "type": "object", "properties": { "chains": { "type": "array", "items": { "$ref": "#/definitions/failover.ChainStatus" } } } }, "localai.FailoverPinRequest": { "type": "object", "properties": { "target": { "type": "string" } } }, "localai.GalleryBackend": { "type": "object", "properties": { "force": { "description": "Force reinstalls the backend even when it is already installed and\nrunnable. Off by default so apply stays idempotent for supervising\napps that ensure their backend on every boot.", "type": "boolean" }, "id": { "type": "string" } } }, "localai.GalleryModel": { "type": "object", "properties": { "backend": { "description": "Backend is the resolved backend engine for this model (e.g. \"llama-cpp\").\nPopulated at load time from overrides, inline config, or the URL-referenced config file.", "type": "string" }, "config_file": { "description": "config_file is read in the situation where URL is blank - and therefore this is a base config.", "type": "object", "additionalProperties": {} }, "description": { "type": "string" }, "files": { "description": "AdditionalFiles are used to add additional files to the model", "type": "array", "items": { "$ref": "#/definitions/gallery.File" } }, "gallery": { "description": "Gallery is a reference to the gallery which contains the model", "allOf": [ { "$ref": "#/definitions/config.Gallery" } ] }, "icon": { "type": "string" }, "id": { "type": "string" }, "installed": { "description": "Installed is used to indicate if the model is installed or not", "type": "boolean" }, "license": { "type": "string" }, "name": { "type": "string" }, "overrides": { "description": "Overrides are used to override the configuration of the model located at URL", "type": "object", "additionalProperties": {} }, "size": { "description": "Size is an optional hardcoded model size string (e.g. \"500MB\", \"14.5GB\").\nUsed when the size cannot be estimated automatically.", "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "url": { "type": "string" }, "urls": { "type": "array", "items": { "type": "string" } }, "variant": { "description": "Variant installs one specific build of an entry that declares variants,\nnamed as it appears in the entry's ` + "`" + `variants` + "`" + ` list (see the ` + "`" + `variants` + "`" + `\nand ` + "`" + `auto_variant` + "`" + ` fields of the gallery listing). Leave it empty to let\nLocalAI auto-select the largest build this host can actually run.", "type": "string" }, "variants": { "description": "Variants is an optional, UNORDERED list of alternative builds of the same\nmodel (other backends such as MLX or vLLM, other quantizations) that the\ninstaller may pick instead of this entry's own payload. Authoring is\ndeliberately dumb: name the models, and the selector works out which one\nthis host should get.\n\nThe entry itself is always the last resort, so an entry carrying variants\nstays a complete, installable entry and older LocalAI releases, which drop\nthis key, install it exactly as before.", "type": "array", "items": { "$ref": "#/definitions/gallery.Variant" } } } }, "localai.LibrarySourcesResponse": { "type": "object", "properties": { "officialLibraries": { "type": "boolean" }, "sources": { "type": "array", "items": { "$ref": "#/definitions/library.Info" } } } }, "localai.ModelExportsStatus": { "type": "object", "properties": { "model_exports": { "description": "ModelExports is false only when this instance does not see the models\npath of the add-on owner. It is the same value as the model_exports key\nof GET /api/features.", "type": "boolean" } } }, "localai.ModelResponse": { "type": "object", "properties": { "config": {}, "config_revision": { "type": "string" }, "details": { "type": "array", "items": { "type": "string" } }, "error": { "type": "string" }, "filename": { "type": "string" }, "message": { "type": "string" }, "pending_cleanup": { "type": "integer" }, "success": { "type": "boolean" } } }, "localai.MotionSessionInfo": { "type": "object", "properties": { "frames": { "type": "integer" }, "id": { "type": "string" }, "model": { "type": "string" }, "poses": { "type": "integer" }, "profile": { "type": "string" }, "time_origin": { "type": "string" }, "upload_accepted": { "type": "integer" }, "upload_dropped": { "type": "integer" } } }, "localai.MotionSessionRequest": { "type": "object", "properties": { "model": { "type": "string" }, "profile": { "type": "string" }, "time_origin": { "type": "string" } } }, "localai.MotionTicketRequest": { "type": "object", "properties": { "origin": { "type": "string" } } }, "localai.TTSModelVoices": { "type": "object", "properties": { "model": { "type": "string" }, "voices": { "type": "array", "items": { "$ref": "#/definitions/config.TTSVoice" } } } }, "localai.TTSVoicesResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/localai.TTSModelVoices" } } } }, "localai.UpdateMaxReplicasPerModelRequest": { "type": "object", "properties": { "value": { "description": "Value is the new per-model replica cap on this node. Must be \u003e= 1.", "type": "integer" } } }, "localai.UpdateVRAMBudgetRequest": { "type": "object", "properties": { "value": { "description": "Value is the VRAM cap (\"80%\" or \"12GB\"). Empty string clears the cap.", "type": "string" } } }, "localai.VoiceProfileListResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/voiceprofile.Profile" } } } }, "middleware.TraceBucket": { "type": "object", "properties": { "count": { "type": "integer" }, "errors": { "type": "integer" }, "start": { "type": "string" } } }, "middleware.TraceSummary": { "type": "object", "properties": { "buckets": { "type": "array", "items": { "$ref": "#/definitions/middleware.TraceBucket" } }, "errors": { "type": "integer" }, "p95_ms": { "type": "integer" }, "total": { "type": "integer" }, "window_hours": { "type": "integer" } } }, "model.BackendLogLine": { "type": "object", "properties": { "stream": { "description": "\"stdout\" or \"stderr\"", "type": "string" }, "text": { "type": "string" }, "timestamp": { "type": "string" } } }, "modeladmin.VRAMRequest": { "type": "object", "properties": { "context_size": { "type": "integer" }, "gpu_layers": { "type": "integer" }, "kv_quant_bits": { "type": "integer" }, "model": { "type": "string" } } }, "modeladmin.VRAMResponse": { "type": "object", "properties": { "context_length": { "type": "integer" }, "context_note": { "type": "string" }, "model_max_context": { "type": "integer" }, "size_bytes": { "type": "integer" }, "size_display": { "type": "string" }, "vram_bytes": { "type": "integer" }, "vram_display": { "type": "string" } } }, "nodes.NodeModel": { "type": "object", "properties": { "address": { "description": "gRPC address for this replica's backend process", "type": "string" }, "backend_type": { "description": "e.g. \"llama-cpp\"; used by reconciler to replicate loads", "type": "string" }, "cleanup_attempts": { "type": "integer" }, "cleanup_error": { "type": "string" }, "cleanup_next_retry_at": { "type": "string" }, "config_revision": { "type": "string" }, "created_at": { "type": "string" }, "effective_options_hash": { "type": "string" }, "id": { "type": "string" }, "in_flight": { "description": "number of active requests on this replica", "type": "integer" }, "last_used": { "type": "string" }, "loading_by": { "description": "frontend ID that triggered loading", "type": "string" }, "model_name": { "type": "string" }, "node_id": { "type": "string" }, "replica_index": { "type": "integer" }, "state": { "description": "staging, loading, loaded, unloading, idle", "type": "string" }, "updated_at": { "type": "string" } } }, "proto.MemoryUsageData": { "type": "object", "properties": { "breakdown": { "type": "object", "additionalProperties": { "type": "integer", "format": "int64" } }, "total": { "type": "integer" } } }, "proto.SpeakerEncoder": { "type": "object", "properties": { "dimension": { "type": "integer" }, "family": { "description": "embedding space of the encoder; empty when the backend cannot tell", "type": "string" }, "identity": { "description": "sha256 of loaded GGUF bytes", "type": "string" } } }, "proto.StatusResponse": { "type": "object", "properties": { "memory": { "$ref": "#/definitions/proto.MemoryUsageData" }, "speaker_encoder": { "description": "trusted metadata from the loaded server encoder, never request data", "allOf": [ { "$ref": "#/definitions/proto.SpeakerEncoder" } ] }, "state": { "$ref": "#/definitions/proto.StatusResponse_State" } } }, "proto.StatusResponse_State": { "type": "integer", "format": "int32", "enum": [ 0, 1, 2, -1 ], "x-enum-varnames": [ "StatusResponse_UNINITIALIZED", "StatusResponse_BUSY", "StatusResponse_READY", "StatusResponse_ERROR" ] }, "proto.VADResponse": { "type": "object", "properties": { "segments": { "type": "array", "items": { "$ref": "#/definitions/proto.VADSegment" } } } }, "proto.VADSegment": { "type": "object", "properties": { "end": { "type": "number" }, "start": { "type": "number" } } }, "recovery.BackupInfo": { "type": "object", "properties": { "addonId": { "type": "string" }, "created": { "type": "string" }, "digest": { "type": "string" }, "files": { "type": "integer" }, "id": { "type": "string" }, "mode": { "description": "Mode and Version are the ownership mode and package version it holds.", "type": "string" }, "pinned": { "description": "Pinned is set while the backup is the recovery copy of an upgrade.", "type": "boolean" }, "reason": { "type": "string" }, "size": { "type": "integer" }, "verification": { "type": "string" }, "verified": { "type": "boolean" }, "version": { "type": "string" } } }, "recovery.BackupReceipt": { "type": "object", "properties": { "addonId": { "type": "string" }, "created": { "type": "string" }, "digest": { "type": "string" }, "files": { "type": "integer" }, "id": { "type": "string" }, "mode": { "description": "Mode and Version are the ownership mode and package version it holds.", "type": "string" }, "pinned": { "description": "Pinned is set while the backup is the recovery copy of an upgrade.", "type": "boolean" }, "reason": { "type": "string" }, "size": { "type": "integer" }, "verified": { "type": "boolean" }, "version": { "type": "string" } } }, "recovery.PurgeReceipt": { "type": "object", "properties": { "addonId": { "type": "string" }, "at": { "type": "string" }, "resources": { "type": "integer" }, "scope": { "$ref": "#/definitions/recovery.PurgeScope" }, "warnings": { "type": "array", "items": { "type": "string" } } } }, "recovery.PurgeScope": { "type": "object", "properties": { "backups": { "description": "Backups are the backups of the add-on.", "type": "boolean" }, "data": { "description": "Data is the add-on's data directory and the owner's records of its\nresources, grants and conversation selections.", "type": "boolean" }, "recoveryCopies": { "description": "RecoveryCopies are the data copies that restores and failed upgrades\nset aside.", "type": "boolean" } } }, "recovery.RestoreReceipt": { "type": "object", "properties": { "actor": { "type": "string" }, "addonId": { "type": "string" }, "at": { "type": "string" }, "backupCreated": { "type": "string" }, "backupId": { "type": "string" }, "lostWrites": { "description": "LostWrites counts the operations applied after the backup. Their\neffects are gone from the data.", "type": "integer" }, "policy": { "$ref": "#/definitions/recovery.RestoreReport" }, "previousCopy": { "description": "PreviousCopy names the directory that holds the data that was replaced.\nIt stays until an administrator purges it.", "type": "string" }, "warnings": { "type": "array", "items": { "type": "string" } } } }, "recovery.RestoreReport": { "type": "object", "properties": { "grantsDropped": { "type": "integer" }, "grantsRestored": { "type": "integer" }, "historyTruncated": { "description": "HistoryTruncated says the record of lowered access may have lost\nentries older than the backup, so no grant of the backup was restored.", "type": "boolean" }, "proposalsCancelled": { "description": "ProposalsCancelled and ProposalsUnknown are the proposals of the add-on\nthat no longer can be confirmed, and the ones whose outcome is looked up\nby receipt and never applied again.", "type": "integer" }, "proposalsUnknown": { "type": "integer" }, "resourcesRestored": { "type": "integer" }, "resourcesSkipped": { "type": "array", "items": { "type": "string" } }, "revoked": { "description": "Revoked counts grants dropped or lowered because access was taken away\nafter the backup.", "type": "integer" } } }, "recovery.RetentionView": { "type": "object", "properties": { "keep": { "type": "integer" }, "maxAgeSeconds": { "type": "integer" } } }, "recovery.Status": { "type": "object", "properties": { "addonId": { "type": "string" }, "backups": { "type": "array", "items": { "$ref": "#/definitions/recovery.BackupInfo" } }, "lastRestore": { "$ref": "#/definitions/recovery.RestoreReceipt" }, "mode": { "description": "Mode is the ownership mode of the owner: named-user or local-owner.", "type": "string" }, "operations": { "description": "Operations lists the operation IDs whose result is recorded, so a\ncaller that lost an answer can see that its request ran.", "type": "array", "items": { "type": "string" } }, "phase": { "description": "Phase is the phase of an upgrade or restore in progress.", "type": "string" }, "previousCopies": { "description": "PreviousCopies counts the data copies a restore set aside.", "type": "integer" }, "reason": { "type": "string" }, "recoveryBackup": { "description": "RecoveryBackup names the copy to restore from.", "type": "string" }, "retention": { "description": "Retention is the policy applied to the backups.", "allOf": [ { "$ref": "#/definitions/recovery.RetentionView" } ] }, "state": { "type": "string" } } }, "schema.APIError": { "type": "object", "properties": { "code": {}, "message": { "type": "string" }, "param": { "type": "string" }, "type": { "type": "string" } } }, "schema.AnimationInput": { "type": "object", "properties": { "data": { "type": "string" }, "type": { "type": "string" } } }, "schema.AnthropicContentBlock": { "type": "object", "properties": { "content": {}, "id": { "type": "string" }, "input": { "type": "object", "additionalProperties": {} }, "is_error": { "type": "boolean" }, "name": { "type": "string" }, "signature": { "type": "string" }, "source": { "$ref": "#/definitions/schema.AnthropicImageSource" }, "text": { "type": "string" }, "thinking": { "type": "string" }, "tool_use_id": { "type": "string" }, "type": { "type": "string" } } }, "schema.AnthropicImageSource": { "type": "object", "properties": { "data": { "type": "string" }, "media_type": { "type": "string" }, "type": { "type": "string" } } }, "schema.AnthropicMessage": { "type": "object", "properties": { "content": {}, "role": { "type": "string" } } }, "schema.AnthropicRequest": { "type": "object", "properties": { "max_tokens": { "type": "integer" }, "messages": { "type": "array", "items": { "$ref": "#/definitions/schema.AnthropicMessage" } }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "model": { "type": "string" }, "stop_sequences": { "type": "array", "items": { "type": "string" } }, "stream": { "type": "boolean" }, "system": { "type": "string" }, "temperature": { "type": "number" }, "thinking": { "description": "Thinking gates extended-thinking output. We only surface thinking\ncontent blocks when the client explicitly opts in, matching Anthropic's\nAPI where thinking is off unless requested.", "allOf": [ { "$ref": "#/definitions/schema.AnthropicThinkingParam" } ] }, "tool_choice": {}, "tools": { "type": "array", "items": { "$ref": "#/definitions/schema.AnthropicTool" } }, "top_k": { "type": "integer" }, "top_p": { "type": "number" } } }, "schema.AnthropicResponse": { "type": "object", "properties": { "content": { "type": "array", "items": { "$ref": "#/definitions/schema.AnthropicContentBlock" } }, "id": { "type": "string" }, "model": { "type": "string" }, "role": { "type": "string" }, "stop_reason": { "type": "string" }, "stop_sequence": { "type": "string" }, "type": { "type": "string" }, "usage": { "$ref": "#/definitions/schema.AnthropicUsage" } } }, "schema.AnthropicThinkingParam": { "type": "object", "properties": { "budget_tokens": { "type": "integer" }, "type": { "description": "\"enabled\" | \"disabled\"", "type": "string" } } }, "schema.AnthropicTool": { "type": "object", "properties": { "description": { "type": "string" }, "input_schema": { "type": "object", "additionalProperties": {} }, "name": { "type": "string" } } }, "schema.AnthropicUsage": { "type": "object", "properties": { "input_tokens": { "type": "integer" }, "output_tokens": { "type": "integer" } } }, "schema.BackendMonitorRequest": { "type": "object", "properties": { "model": { "type": "string" } } }, "schema.BackendResponse": { "type": "object", "properties": { "id": { "type": "string" }, "status_url": { "type": "string" } } }, "schema.ChatsAddon": { "type": "object", "properties": { "id": { "type": "string" }, "off": { "type": "boolean" }, "tools": { "type": "integer" } } }, "schema.ChatsAddonList": { "type": "object", "properties": { "addons": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsAddon" } }, "commands": { "description": "Commands says whether the chat can run commands and code at its next\nturn: available, off (the add-on that runs them is switched off for this\nchat or not named by its agent), unavailable (installed, but it cannot run\nthem on this server), none (no add-on that runs them is installed for\nthe user) or switched_off (the chat switched the shell group off, so\nnothing runs them whoever would serve them).", "type": "string" }, "commands_consent": { "description": "CommandsConsent is ask when each command of the built-in bash waits for\na yes in the chat.", "type": "string" }, "commands_fallback": { "description": "CommandsFallback is the add-on that would serve bash but does not (it is\noff for this chat, or cannot run), when the built-in serves instead;\nCommandsFallbackReason says why: off, or the add-on's reason.", "type": "string" }, "commands_fallback_reason": { "type": "string" }, "commands_isolation": { "description": "CommandsIsolation is isolated (a sandbox) or host (directly on this\nmachine, with its files and network), when Commands is available.", "type": "string" }, "commands_provider": { "description": "CommandsProvider serves bash, when Commands is available: builtin (the\nbuilt-in bash on this machine) or the ID of the add-on.", "type": "string" }, "commands_reason": { "description": "CommandsReason is why commands cannot run, when Commands is unavailable.", "type": "string" } } }, "schema.ChatsAddonSwitches": { "type": "object", "properties": { "off": { "type": "array", "items": { "type": "string" } } } }, "schema.ChatsAdminAgent": { "type": "object", "properties": { "addons": { "type": "array", "items": { "type": "string" } }, "collections": { "type": "array", "items": { "type": "string" } }, "created": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "string" }, "mcp_servers": { "type": "array", "items": { "type": "string" } }, "model": { "type": "string" }, "name": { "type": "string" }, "owner": { "type": "string" }, "skills": { "type": "array", "items": { "type": "string" } }, "updated": { "type": "string" } } }, "schema.ChatsAdminAgentList": { "type": "object", "properties": { "agents": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsAdminAgent" } } } }, "schema.ChatsAdminConnector": { "type": "object", "properties": { "accept_any": { "type": "boolean" }, "active": { "description": "Active is false when the add-on that serves the binding is not running. The\nbinding is kept and works once the add-on is installed.", "type": "boolean" }, "addon": { "type": "string" }, "agent_id": { "type": "string" }, "allow": { "type": "array", "items": { "type": "string" } }, "conversation": { "description": "Conversation says which chat a message belongs to: sender (one chat\nper sender and per platform thread), chat (one chat per group, channel\nor direct chat), window (sender, and a new chat after window_minutes\nwithout a message) or thread (a new chat per message; a reply to an\nanswer goes on in its chat).", "type": "string" }, "created": { "type": "string" }, "enabled": { "type": "boolean" }, "has_token": { "type": "boolean" }, "id": { "type": "string" }, "kind": { "type": "string" }, "name": { "type": "string" }, "notify_chat": { "type": "string" }, "owner": { "type": "string" }, "reason": { "description": "Reason says in plain words why the binding is not active.", "type": "string" }, "reply_mode": { "description": "ReplyMode is what a sender sees while a turn runs: off (typing, then\nthe answer), progress (a working message that names the tools as they\nstart) or stream (a working message that shows the answer as it is\nwritten). The answer replaces the working message.", "type": "string" }, "send_files": { "description": "SendFiles sends the files that a turn makes to the sender, after the\nanswer.", "type": "boolean" }, "window_minutes": { "type": "integer" } } }, "schema.ChatsAdminConnectorList": { "type": "object", "properties": { "connectors": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsAdminConnector" } } } }, "schema.ChatsAdminTrigger": { "type": "object", "properties": { "agent_id": { "type": "string" }, "cost": { "$ref": "#/definitions/schema.ChatsTriggerCost" }, "daily_cap": { "type": "integer" }, "enabled": { "type": "boolean" }, "folder": { "type": "string" }, "id": { "type": "string" }, "kind": { "type": "string" }, "last_done": { "type": "string" }, "last_run": { "description": "LastRun is the newest run, if any, and LastDone the end of the newest\nrun that finished without an error.", "allOf": [ { "$ref": "#/definitions/schema.ChatsTriggerRun" } ] }, "min_gap_seconds": { "description": "MinGapSeconds is the shortest time between two runs of a file trigger.", "type": "integer" }, "model": { "type": "string" }, "name": { "type": "string" }, "next_run": { "type": "string" }, "owner": { "type": "string" }, "plan": { "description": "Plan says what a run reads and writes and which Home widget shows the\nfile it writes; Cost what a run costs.", "allOf": [ { "$ref": "#/definitions/schema.ChatsTriggerPlan" } ] }, "prompt": { "type": "string" }, "quiet_seconds": { "type": "integer" }, "schedule": { "type": "string" }, "source_chat_id": { "type": "string" }, "summary": { "description": "Summary says when it runs in plain words. NextRun is set for a schedule\ntrigger that is on.", "type": "string" }, "time_zone": { "type": "string" } } }, "schema.ChatsAdminTriggerList": { "type": "object", "properties": { "triggers": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsAdminTrigger" } } } }, "schema.ChatsAgent": { "type": "object", "properties": { "addons": { "type": "array", "items": { "type": "string" } }, "collections": { "type": "array", "items": { "type": "string" } }, "created": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "string" }, "instructions": { "type": "string" }, "mcp_servers": { "type": "array", "items": { "type": "string" } }, "model": { "type": "string" }, "name": { "type": "string" }, "network": { "description": "Network is the network preset of the Sandbox commands of the agent's\nunattended runs: off (the default), registries or all, capped by the\nadministrator's ceiling.", "type": "string" }, "skills": { "type": "array", "items": { "type": "string" } }, "updated": { "type": "string" } } }, "schema.ChatsAgentExport": { "type": "object", "properties": { "agent": { "$ref": "#/definitions/schema.ChatsAgentWrite" }, "exported_at": { "type": "string" }, "kind": { "type": "string" }, "version": { "type": "integer" } } }, "schema.ChatsAgentHistory": { "type": "object", "properties": { "failed": { "type": "integer" }, "running": { "type": "integer" }, "runs": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsAgentRun" } }, "total": { "description": "Total, Failed and Running count every run of the agent among your newest\n5,000 chats, not only the ones listed.", "type": "integer" } } }, "schema.ChatsAgentImportResult": { "type": "object", "properties": { "agent": { "$ref": "#/definitions/schema.ChatsAgent" }, "warnings": { "description": "Warnings say what the import changed: a model this server does not have\nor you may not use is dropped, and a name you already use gets a number.", "type": "array", "items": { "type": "string" } } } }, "schema.ChatsAgentList": { "type": "object", "properties": { "agents": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsAgent" } } } }, "schema.ChatsAgentRun": { "type": "object", "properties": { "chat_id": { "type": "string" }, "created": { "type": "string" }, "last_turn": { "description": "LastTurn is how its last turn ended: done, stopped, failed, interrupted or paused.", "type": "string" }, "model": { "type": "string" }, "origin": { "description": "Origin is empty for a chat you had with the agent, trigger or connector\nfor one that started by itself; OriginID names the trigger or binding.", "type": "string" }, "origin_id": { "type": "string" }, "running": { "type": "boolean" }, "title": { "type": "string" }, "updated": { "type": "string" } } }, "schema.ChatsAgentTemplate": { "type": "object", "properties": { "description": { "type": "string" }, "id": { "type": "string" }, "instructions": { "type": "string" }, "name": { "type": "string" } } }, "schema.ChatsAgentTemplateList": { "type": "object", "properties": { "templates": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsAgentTemplate" } } } }, "schema.ChatsAgentTemplateUse": { "type": "object", "properties": { "name": { "description": "Name replaces the template's name.", "type": "string" } } }, "schema.ChatsAgentWrite": { "type": "object", "properties": { "addons": { "type": "array", "items": { "type": "string" } }, "collections": { "type": "array", "items": { "type": "string" } }, "description": { "type": "string" }, "instructions": { "type": "string" }, "mcp_servers": { "type": "array", "items": { "type": "string" } }, "model": { "type": "string" }, "name": { "type": "string" }, "network": { "type": "string" }, "skills": { "type": "array", "items": { "type": "string" } } } }, "schema.ChatsAttachment": { "type": "object", "properties": { "mime": { "type": "string" }, "missing": { "description": "Missing is true when the file is no longer in your files.", "type": "boolean" }, "name": { "type": "string" }, "path": { "description": "Path is the file's path inside your home, for the files API\n(GET /api/chats/files/content?path=). It follows a rename of the chat's\nfolder.", "type": "string" }, "size": { "description": "Size is in bytes.", "type": "integer" }, "version": { "description": "Version is the version of the file that the message carried.", "type": "integer" } } }, "schema.ChatsBrowserImport": { "type": "object", "properties": { "failed": { "type": "integer" }, "imported": { "description": "Imported chats are new. Skipped ones were there already, or have no\ncreation date or no message to import. Failed ones could not be stored.", "type": "integer" }, "skipped": { "type": "integer" } } }, "schema.ChatsBuiltinGroup": { "type": "object", "properties": { "group": { "type": "string", "example": "web" }, "off": { "type": "boolean" }, "opt_in": { "description": "OptIn says that the group is off until the chat switches it on with\n\"on\" (saved_agents).", "type": "boolean" }, "provider": { "description": "Provider is \"builtin\" when LocalAI serves the tools itself, the ID of\nthe add-on that serves them in this chat when one shadows them, or\n\"mixed\" when the tools have different providers.", "type": "string", "example": "builtin" }, "providers": { "description": "Providers says who serves each tool, by tool name.", "type": "object", "additionalProperties": { "type": "string" }, "example": { "web_search": "builtin" } }, "reason": { "type": "string" }, "tools": { "type": "array", "items": { "type": "string" }, "example": [ "web_search", "web_fetch" ] }, "usable": { "description": "Usable is false when the group cannot serve this chat now; Reason says\nwhy.", "type": "boolean" } } }, "schema.ChatsBuiltinSkill": { "type": "object", "properties": { "candidates": { "description": "Candidates are the add-ons that replace it, by ID, and Titles their\ntitles; Pinned the one chosen in chats_tool_providers.\nCandidates come oldest install first; Default is the first, the one\nthat serves with no pin. InstalledAt maps a candidate to its install\ntime (RFC 3339, UTC) when known.", "type": "array", "items": { "type": "string" } }, "default": { "type": "string" }, "id": { "type": "string" }, "installed_at": { "type": "object", "additionalProperties": { "type": "string" } }, "note": { "description": "Note says why the built-in serves although an add-on replaces it, or is\nempty: the chosen add-on is not running.", "type": "string" }, "pinned": { "type": "string" }, "provider": { "description": "Provider serves it now: builtin or an add-on's ID.", "type": "string" }, "titles": { "type": "object", "additionalProperties": { "type": "string" } } } }, "schema.ChatsBuiltinSwitches": { "type": "object", "properties": { "off": { "type": "array", "items": { "type": "string" } }, "on": { "description": "On lists the opt-in groups the chat switches on (saved_agents). Omit\nit to keep them as they are.", "type": "array", "items": { "type": "string" } } } }, "schema.ChatsBuiltinTool": { "type": "object", "properties": { "candidates": { "description": "Candidates are the add-ons that replace it; Pinned the one chosen.\nCandidates come oldest install first; Default is the first, the one\nthat serves with no pin (\"installed first\"). InstalledAt maps a\ncandidate to its install time (RFC 3339, UTC) when known.", "type": "array", "items": { "type": "string" } }, "default": { "type": "string" }, "description": { "type": "string" }, "enabled": { "type": "boolean" }, "group": { "description": "Group is the per-chat switch group (web), or empty.", "type": "string" }, "id": { "type": "string" }, "installed_at": { "type": "object", "additionalProperties": { "type": "string" } }, "label": { "type": "string" }, "mode": { "description": "Mode is chats_host_exec as it applies (bash only): off, ask or on.", "type": "string" }, "note": { "description": "Note is \"not running\" when an installed add-on replaces the tool but\nnone serves now, so the built-in serves (or nothing, when it is off).", "type": "string" }, "options": { "type": "array", "items": { "type": "string" } }, "pinned": { "type": "string" }, "provider": { "description": "Provider serves it now: builtin, an add-on's ID, or empty for nothing.", "type": "string" }, "read_only": { "description": "ReadOnly says the tool only reads; Replaceable that an add-on tool may\nreplace it by declaring shadows with its name.", "type": "boolean" }, "replaceable": { "type": "boolean" }, "setting": { "description": "Setting is the runtime setting that switches it off; Options are the\nother runtime settings that configure it.", "type": "string" }, "stopped": { "type": "array", "items": { "type": "string" } }, "titles": { "description": "Titles maps a candidate to its title. Stopped lists the candidates that\nare installed but stopped or disabled: they can be chosen, and serve\nonce they run.", "type": "object", "additionalProperties": { "type": "string" } }, "unavailable": { "description": "Unavailable says why this server cannot run the built-in, or is empty.", "type": "string" } } }, "schema.ChatsBuiltinToolList": { "type": "object", "properties": { "skills": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsBuiltinSkill" } }, "tools": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsBuiltinTool" } } } }, "schema.ChatsChatFile": { "type": "object", "properties": { "at": { "type": "string" }, "changed": { "description": "Changed is true when the chat changed a file it did not create.", "type": "boolean" }, "guest_path": { "type": "string" }, "kind": { "description": "Kind is \"deliverable\" or \"working\". A working file is one the chat\nmade on the way: anything in a chat's work folder (Chats/\u003cchat\u003e/work),\nor a script, a log or a temporary file elsewhere (by extension, or in\na folder named scripts, tmp or scratch). Pages, the LocalAI folder,\nthe shared folders and the files you attached are deliverables.", "type": "string" }, "media": { "description": "Media is true for an attachment that the model received as an image\nor a video inside its message.", "type": "boolean" }, "mime": { "type": "string" }, "name": { "type": "string" }, "origin": { "description": "Origin is \"user\" (attached by the user or put in the chat folder),\n\"model\" (written by the model in the sandbox) or \"tool\" (written by a\nhost tool of the chat, such as write_file).", "type": "string" }, "path": { "description": "Path is the current path in the user's files (\"/\" is the home folder),\nfor the files API. GuestPath is the path the model's tools use.", "type": "string" }, "size": { "type": "integer" }, "turn": { "description": "Turn is the turn that brought the file in; 0 when not known.", "type": "integer" } } }, "schema.ChatsChatFileList": { "type": "object", "properties": { "files": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsChatFile" } }, "folder": { "description": "Folder is the guest path of the chat folder; empty until a file is\nattached. FolderPath is the same folder in the user's files.", "type": "string" }, "folder_path": { "type": "string" }, "stale": { "description": "Stale are old chat folder paths that earlier messages name, such as\nthe folder's name before a rename. The model is told the new one.", "type": "array", "items": { "type": "string" } } } }, "schema.ChatsChatHit": { "type": "object", "properties": { "chat": { "$ref": "#/definitions/schema.ChatsConversation" }, "in_title": { "description": "InTitle is true when the title matches.", "type": "boolean" }, "seq": { "description": "Seq is the first matching transcript line, or 0 when only the title matches.", "type": "integer" }, "snippet": { "description": "Snippet is the matching text with a little around it.", "type": "string" } } }, "schema.ChatsChatSearchResponse": { "type": "object", "properties": { "hits": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsChatHit" } } } }, "schema.ChatsConnector": { "type": "object", "properties": { "accept_any": { "type": "boolean" }, "active": { "description": "Active is false when the add-on that serves the binding is not running. The\nbinding is kept and works once the add-on is installed.", "type": "boolean" }, "addon": { "type": "string" }, "agent_id": { "type": "string" }, "allow": { "type": "array", "items": { "type": "string" } }, "conversation": { "description": "Conversation says which chat a message belongs to: sender (one chat\nper sender and per platform thread), chat (one chat per group, channel\nor direct chat), window (sender, and a new chat after window_minutes\nwithout a message) or thread (a new chat per message; a reply to an\nanswer goes on in its chat).", "type": "string" }, "created": { "type": "string" }, "enabled": { "type": "boolean" }, "has_token": { "type": "boolean" }, "id": { "type": "string" }, "kind": { "type": "string" }, "name": { "type": "string" }, "notify_chat": { "type": "string" }, "reason": { "description": "Reason says in plain words why the binding is not active.", "type": "string" }, "reply_mode": { "description": "ReplyMode is what a sender sees while a turn runs: off (typing, then\nthe answer), progress (a working message that names the tools as they\nstart) or stream (a working message that shows the answer as it is\nwritten). The answer replaces the working message.", "type": "string" }, "send_files": { "description": "SendFiles sends the files that a turn makes to the sender, after the\nanswer.", "type": "boolean" }, "window_minutes": { "type": "integer" } } }, "schema.ChatsConnectorKind": { "type": "object", "properties": { "addon": { "type": "string" }, "description": { "type": "string" }, "kind": { "type": "string" }, "page": { "description": "Page is the add-on page that adds and edits bindings of this kind.", "type": "string" }, "sender_hint": { "type": "string" }, "title": { "type": "string" } } }, "schema.ChatsConnectorKindList": { "type": "object", "properties": { "kinds": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsConnectorKind" } } } }, "schema.ChatsConnectorList": { "type": "object", "properties": { "connectors": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsConnector" } } } }, "schema.ChatsConnectorSender": { "type": "object", "properties": { "allowed": { "type": "boolean" }, "count": { "type": "integer" }, "first": { "type": "string" }, "id": { "type": "string" }, "last": { "type": "string" }, "name": { "type": "string" } } }, "schema.ChatsConnectorSenderList": { "type": "object", "properties": { "senders": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsConnectorSender" } } } }, "schema.ChatsConnectorTest": { "type": "object", "properties": { "bot_id": { "type": "string" }, "bot_username": { "type": "string" } } }, "schema.ChatsConnectorWrite": { "type": "object", "properties": { "accept_any": { "type": "boolean" }, "agent_id": { "type": "string" }, "allow": { "type": "array", "items": { "type": "string" } }, "confirm_accept_any": { "description": "ConfirmAcceptAny must be the exact text \"accept any message\" in the\nrequest that turns accept_any on (a create with accept_any, or an update\nthat changes it from off to on). Anyone who can message the bot then uses\nthe agent's tools as you, so the server asks you to say you mean it.", "type": "string" }, "conversation": { "description": "Conversation is sender, chat, window or thread; empty means sender.", "type": "string" }, "enabled": { "type": "boolean" }, "kind": { "description": "Kind is the platform, such as telegram. It is used to create a binding and\nignored by an update. Empty means telegram.", "type": "string" }, "name": { "type": "string" }, "notify_chat": { "type": "string" }, "reply_mode": { "description": "ReplyMode is off, progress or stream; empty means progress.", "type": "string" }, "send_files": { "description": "SendFiles turns the sending of a turn's files on or off. Absent means\non for a new binding and unchanged for an update.", "type": "boolean" }, "token": { "type": "string" }, "window_minutes": { "description": "WindowMinutes is the time window of the window mode, 1 to 10080.", "type": "integer" } } }, "schema.ChatsContextResult": { "type": "object", "properties": { "after": { "type": "integer" }, "before": { "type": "integer" } } }, "schema.ChatsConversation": { "type": "object", "properties": { "agent_id": { "description": "AgentID is the saved agent the chat runs with. Origin is trigger or\nconnector for a chat that started by itself, and OriginID names the trigger\nor binding.", "type": "string" }, "assistant": { "description": "Assistant is true for a chat that has the LocalAI management tools.", "type": "boolean" }, "created": { "type": "string" }, "goal": { "description": "Goal is the chat's goal, when it has one.", "allOf": [ { "$ref": "#/definitions/schema.ChatsGoal" } ] }, "id": { "type": "string" }, "kind": { "description": "chat or subagent", "type": "string" }, "last_turn": { "type": "string" }, "model": { "type": "string" }, "origin": { "type": "string" }, "origin_id": { "type": "string" }, "parent_id": { "type": "string" }, "running": { "description": "Running is true while a turn runs. LastTurn is how the last finished turn\nended: done, stopped, failed, interrupted, or paused (the tool loop\nreached its step limit; send a message to go on).", "type": "boolean" }, "settings": { "description": "Settings are the chat's own model settings, when it has any.", "allOf": [ { "$ref": "#/definitions/schema.ChatsSettings" } ] }, "title": { "type": "string" }, "updated": { "type": "string" } } }, "schema.ChatsConversationDetail": { "type": "object", "properties": { "agent_id": { "description": "AgentID is the saved agent the chat runs with. Origin is trigger or\nconnector for a chat that started by itself, and OriginID names the trigger\nor binding.", "type": "string" }, "assistant": { "description": "Assistant is true for a chat that has the LocalAI management tools.", "type": "boolean" }, "created": { "type": "string" }, "goal": { "description": "Goal is the chat's goal, when it has one.", "allOf": [ { "$ref": "#/definitions/schema.ChatsGoal" } ] }, "host_consent": { "description": "HostConsent is the card of a command of the built-in bash that waits for\na yes while a turn runs; answer it with POST /api/chats/{id}/host-exec/consent.", "allOf": [ { "$ref": "#/definitions/schema.ChatsHostConsent" } ] }, "id": { "type": "string" }, "kind": { "description": "chat or subagent", "type": "string" }, "last_turn": { "type": "string" }, "loops": { "description": "Loops are the loops of the chat, oldest first (GET /api/chats/{id}/loops).", "type": "array", "items": { "$ref": "#/definitions/schema.ChatsLoop" } }, "model": { "type": "string" }, "origin": { "type": "string" }, "origin_id": { "type": "string" }, "parent_id": { "type": "string" }, "pending": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsPending" } }, "running": { "description": "Running is true while a turn runs. LastTurn is how the last finished turn\nended: done, stopped, failed, interrupted, or paused (the tool loop\nreached its step limit; send a message to go on).", "type": "boolean" }, "settings": { "description": "Settings are the chat's own model settings, when it has any.", "allOf": [ { "$ref": "#/definitions/schema.ChatsSettings" } ] }, "title": { "type": "string" }, "updated": { "type": "string" } } }, "schema.ChatsConversationList": { "type": "object", "properties": { "conversations": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsConversation" } }, "files": { "description": "Files is false when the workspace is off; FilesReason then says why.", "type": "boolean" }, "files_reason": { "type": "string" }, "image_model": { "description": "ImageModel is the model that describes the images of a chat whose own\nmodel cannot look at them. It is empty when no model can.", "type": "string" }, "persistent": { "description": "Persistent is false when conversations live in memory and are lost when\nthe server restarts.", "type": "boolean" } } }, "schema.ChatsConversion": { "type": "object", "properties": { "at": { "type": "string" }, "counts": { "$ref": "#/definitions/schema.ChatsConversionTotals" }, "done": { "description": "Done says a conversion ran at least once.", "type": "boolean" }, "items": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsConversionItem" } }, "totals": { "description": "Totals is set for an administrator: the counts of all users together.", "allOf": [ { "$ref": "#/definitions/schema.ChatsConversionTotals" } ] } } }, "schema.ChatsConversionItem": { "type": "object", "properties": { "kind": { "description": "Kind is agent, trigger, skill, chat or connector.", "type": "string" }, "name": { "type": "string" }, "reason": { "description": "Reason names what was dropped or what went wrong. It holds no secret.", "type": "string" }, "status": { "description": "Status is converted, skipped, failed or dropped.", "type": "string" } } }, "schema.ChatsConversionTotals": { "type": "object", "properties": { "converted": { "type": "integer" }, "dropped": { "type": "integer" }, "failed": { "type": "integer" }, "skipped": { "type": "integer" } } }, "schema.ChatsCreateRequest": { "type": "object", "properties": { "agent_id": { "description": "AgentID starts the chat with one of your saved agents. The agent's model,\nwhen it has one, replaces Model, which is then optional.", "type": "string" }, "assistant": { "description": "Assistant starts the chat with the LocalAI management tools (install\nmodels and backends, change settings). It needs an administrator and the\nassistant setting on, and it cannot be combined with AgentID.", "type": "boolean" }, "model": { "description": "Model is the model the conversation talks to. It cannot change later.", "type": "string" }, "switches": { "description": "Switches are the tools, add-ons and skills the chat starts with\nswitched off (and the opt-in tools switched on), as the composer of a\nnew chat drafts them. They are stored with the chat: the chat never\nexists without them. A bad entry refuses the whole request.", "allOf": [ { "$ref": "#/definitions/schema.ChatsSwitches" } ] }, "title": { "description": "Title is optional; the conversation is named after its first message otherwise.", "type": "string" } } }, "schema.ChatsEditRequest": { "type": "object", "properties": { "text": { "type": "string" } } }, "schema.ChatsEgress": { "type": "object", "properties": { "addon": { "description": "Addon is the add-on that runs the chat's commands and carries the\nnetwork-policy host control: the chat draws its Network row and links\nan administrator to that add-on's settings. Absent when applies is\nfalse or no such add-on runs the commands.", "type": "string", "example": "sandbox" }, "allowed_hosts": { "description": "AllowedHosts is the administrator's always-allowed list (host or\nhost:port), read only here: it applies when the effective preset is\nregistries or all.", "type": "array", "items": { "type": "string" } }, "applies": { "description": "Applies is false when commands run on this machine (applies_reason\nhost) or no Sandbox serves bash (none).", "type": "boolean" }, "applies_reason": { "type": "string" }, "cards": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsEgressCard" } }, "ceiling": { "description": "the administrator's limit", "type": "string" }, "effective": { "description": "the lower of the two", "type": "string" }, "preset": { "description": "off, registries, all", "type": "string" }, "registries": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsEgressRegistry" } }, "rules": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsEgressRule" } } } }, "schema.ChatsEgressAdmin": { "type": "object", "properties": { "allow_private": { "type": "boolean" }, "allowed_24h": { "type": "integer" }, "allowed_hosts": { "type": "array", "items": { "type": "string" } }, "audit_days": { "type": "integer" }, "blocked_24h": { "type": "integer" }, "ceiling": { "type": "string" }, "default": { "type": "string" }, "extra_registries": { "type": "array", "items": { "type": "string" } }, "isolation": { "type": "string" }, "ports": { "type": "array", "items": { "type": "integer" } }, "registries": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsEgressRegistry" } }, "sandbox": { "description": "Sandbox is the add-on that runs commands, empty when none serves;\nIsolation is isolated, host, or empty when unknown.", "type": "string" } } }, "schema.ChatsEgressCard": { "type": "object", "properties": { "above_ceiling": { "description": "AboveCeiling says the administrator's limit does not admit this host,\nso no answer can make it work; only a higher limit does.", "type": "boolean" }, "answered_at": { "type": "string" }, "answered_by": { "type": "string" }, "asked_at": { "type": "string" }, "host": { "type": "string" }, "id": { "type": "string" }, "kind": { "type": "string" }, "port": { "type": "integer" }, "private": { "type": "boolean" }, "state": { "description": "pending, once, chat, denied, expired, refused", "type": "string" }, "tool_seq": { "type": "integer" } } }, "schema.ChatsEgressConsent": { "type": "object", "properties": { "decision": { "type": "string" }, "id": { "type": "string" } } }, "schema.ChatsEgressEvent": { "type": "object", "properties": { "addr": { "type": "string" }, "at": { "type": "string" }, "bytes_down": { "type": "integer" }, "bytes_up": { "type": "integer" }, "chat": { "type": "string" }, "duration_ms": { "type": "integer" }, "host": { "type": "string" }, "kind": { "type": "string" }, "port": { "type": "integer" }, "reason": { "type": "string" }, "user": { "type": "string" }, "user_name": { "type": "string" }, "verdict": { "description": "allow, block, done", "type": "string" } } }, "schema.ChatsEgressEventList": { "type": "object", "properties": { "events": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsEgressEvent" } } } }, "schema.ChatsEgressPreset": { "type": "object", "properties": { "preset": { "type": "string" } } }, "schema.ChatsEgressRegistry": { "type": "object", "properties": { "hosts": { "type": "array", "items": { "type": "string" } }, "id": { "type": "string" }, "title": { "type": "string" } } }, "schema.ChatsEgressRule": { "type": "object", "properties": { "above_limit": { "description": "AboveLimit says the ceiling no longer admits the host, so the rule\ndoes not apply until an administrator raises it.", "type": "boolean" }, "admin": { "type": "boolean" }, "allow": { "type": "boolean" }, "at": { "type": "string" }, "by": { "type": "string" }, "host": { "type": "string" }, "port": { "type": "integer" } } }, "schema.ChatsEvent": { "type": "object", "properties": { "after": { "type": "integer" }, "before": { "description": "Before and After are context sizes in tokens, for compacted.", "type": "integer" }, "code": { "description": "Code, Model, Retry and Detail say why a turn failed (error only). Code\nis a stable name of the cause, such as model_backend_missing; Model names\nthe model it is about; Retry is the seconds until a model in cooldown\nloads again; Detail is the error text without addresses and secrets.", "type": "string" }, "detail": { "type": "string" }, "ids": { "description": "IDs names the messages of pending_delivered, the conversation of\nsub_agent_started and sub_agent_done, or the proposal of trigger_proposed.", "type": "array", "items": { "type": "string" } }, "kind": { "type": "string" }, "model": { "type": "string" }, "retry": { "type": "integer" }, "steps": { "description": "Steps is the step limit that a paused turn reached (paused only).", "type": "integer" }, "text": { "type": "string" }, "tool": { "description": "Tool is set for tool_start and tool_end.", "allOf": [ { "$ref": "#/definitions/schema.ChatsToolEvent" } ] }, "turn": { "type": "integer" }, "usage": { "description": "Usage is set on usage events: what one model request used.", "allOf": [ { "$ref": "#/definitions/schema.ChatsUsage" } ] } } }, "schema.ChatsExport": { "type": "object", "properties": { "created": { "type": "string" }, "exported_at": { "type": "string" }, "messages": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsExportMessage" } }, "model": { "type": "string" }, "settings": { "$ref": "#/definitions/schema.ChatsSettings" }, "title": { "type": "string" }, "updated": { "type": "string" }, "version": { "type": "integer" } } }, "schema.ChatsExportMessage": { "type": "object", "properties": { "at": { "type": "string" }, "role": { "type": "string" }, "text": { "type": "string" } } }, "schema.ChatsFile": { "type": "object", "properties": { "conflict_of": { "description": "ConflictOf is set when an upload kept both files: it is the path the\ncaller asked for, and Path is where the new content went.", "type": "string" }, "kind": { "description": "file or dir", "type": "string" }, "managed": { "description": "Managed is set on a path LocalAI manages: \"localai\" for the LocalAI\nfolder and the settings files in it, \"chats\" for the Chats folder.", "type": "string" }, "modified": { "description": "Modified is when the entry last changed. A folder listing sets it.", "type": "string" }, "name": { "type": "string" }, "path": { "type": "string" }, "rev": { "type": "integer" }, "size": { "type": "integer" }, "version": { "type": "integer" } } }, "schema.ChatsFileConflict": { "type": "object", "properties": { "path": { "type": "string" }, "reason": { "type": "string" } } }, "schema.ChatsFileList": { "type": "object", "properties": { "entries": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsFile" } }, "max_file_size": { "description": "MaxFileSize is the largest file an upload may send, in bytes. Zero or\nabsent: the server reports no limit.", "type": "integer" }, "path": { "type": "string" } } }, "schema.ChatsFileOp": { "type": "object", "properties": { "from": { "type": "string" }, "kind": { "description": "create, write, move or delete", "type": "string" }, "path": { "type": "string" } } }, "schema.ChatsFilePreview": { "type": "object", "properties": { "blocks": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsFilePreviewBlock" } }, "kind": { "type": "string" }, "sheets": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsFilePreviewSheet" } }, "slides": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsFilePreviewSlide" } }, "truncated": { "description": "Truncated is set when a document or presentation had more text than\nthe preview keeps.", "type": "boolean" } } }, "schema.ChatsFilePreviewBlock": { "type": "object", "properties": { "level": { "type": "integer" }, "rows": { "type": "array", "items": { "type": "array", "items": { "type": "string" } } }, "text": { "type": "string" }, "type": { "type": "string" } } }, "schema.ChatsFilePreviewLine": { "type": "object", "properties": { "level": { "type": "integer" }, "text": { "type": "string" } } }, "schema.ChatsFilePreviewSheet": { "type": "object", "properties": { "name": { "type": "string" }, "rows": { "type": "array", "items": { "type": "array", "items": { "type": "string" } } }, "total_cols": { "type": "integer" }, "total_rows": { "type": "integer" } } }, "schema.ChatsFilePreviewSlide": { "type": "object", "properties": { "lines": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsFilePreviewLine" } }, "n": { "type": "integer" }, "notes": { "type": "string" }, "title": { "type": "string" } } }, "schema.ChatsFolderRequest": { "type": "object", "properties": { "path": { "type": "string" } } }, "schema.ChatsForkRequest": { "type": "object", "properties": { "from_seq": { "description": "FromSeq is the last transcript line to copy; 0 copies everything.", "type": "integer" }, "title": { "description": "Title names the new chat; it defaults to the old title and \"(fork)\".", "type": "string" } } }, "schema.ChatsGoal": { "type": "object", "properties": { "max_steps": { "type": "integer" }, "max_turns": { "type": "integer" }, "note": { "description": "Note is the model's summary of a done goal, or the reason of a blocked\none.", "type": "string" }, "paused_by": { "description": "PausedBy says why a paused goal paused: user, turn_limit, step_limit,\nerror or interrupted.", "type": "string" }, "set": { "type": "string" }, "state": { "description": "State is active, paused, done or blocked.", "type": "string" }, "steps": { "type": "integer" }, "text": { "type": "string" }, "turns": { "description": "Turns and Steps count the automatic turns and the model steps since the\ngoal was set or last resumed; MaxTurns and MaxSteps are the limits that\napply now (chats_goal_max_turns, chats_goal_max_steps).", "type": "integer" }, "updated": { "type": "string" } } }, "schema.ChatsGoalRequest": { "type": "object", "properties": { "text": { "description": "Text is the goal, 1 to 2000 characters.", "type": "string" } } }, "schema.ChatsGoalResponse": { "type": "object", "properties": { "goal": { "$ref": "#/definitions/schema.ChatsGoal" }, "replaced": { "$ref": "#/definitions/schema.ChatsGoal" } } }, "schema.ChatsHistory": { "type": "object", "properties": { "entries": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsHistoryEntry" } } } }, "schema.ChatsHistoryEntry": { "type": "object", "properties": { "at": { "type": "string" }, "chat": { "type": "string" }, "kind": { "description": "user, agent, upload or undo", "type": "string" }, "ops": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsFileOp" } }, "rev": { "type": "integer" }, "title": { "type": "string" } } }, "schema.ChatsHostConsent": { "type": "object", "properties": { "command": { "type": "string" }, "id": { "type": "string" } } }, "schema.ChatsHostExecConsent": { "type": "object", "properties": { "decision": { "type": "string", "enum": [ "once", "deny" ] }, "id": { "type": "string" } } }, "schema.ChatsHostExecEvent": { "type": "object", "properties": { "at": { "type": "string" }, "chat": { "type": "string" }, "command": { "type": "string" }, "duration_ms": { "type": "integer" }, "exit": { "type": "integer" }, "timed_out": { "type": "boolean" }, "user": { "type": "string" }, "user_name": { "type": "string" } } }, "schema.ChatsHostExecEventList": { "type": "object", "properties": { "events": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsHostExecEvent" } } } }, "schema.ChatsImportRequest": { "type": "object", "properties": { "chat": { "$ref": "#/definitions/schema.ChatsExport" }, "model": { "description": "Model replaces the model of the file. It is needed when the file names none.", "type": "string" } } }, "schema.ChatsInvocation": { "type": "object", "properties": { "id": { "description": "the saved agent's id", "type": "string" }, "kind": { "description": "skill or agent", "type": "string" }, "name": { "type": "string" } } }, "schema.ChatsLoop": { "type": "object", "properties": { "created": { "type": "string" }, "failures": { "description": "Failures counts the failed runs in a row; three pause the loop.", "type": "integer" }, "id": { "type": "string" }, "interval": { "description": "Interval is the time between runs, such as 5m; empty for a self-paced\nloop, which runs again when the model asks.", "type": "string" }, "interval_seconds": { "description": "IntervalSeconds is Interval in seconds; 0 for a self-paced loop.", "type": "integer" }, "last_run": { "type": "string" }, "next": { "description": "Next is when the next run is due; absent while a run goes on or the\nloop does not run.", "type": "string" }, "prompt": { "type": "string" }, "reason": { "description": "Reason says why the loop is paused or ended, or why it waits.", "type": "string" }, "running": { "description": "Running is true while a run of the loop goes on in the chat.", "type": "boolean" }, "runs": { "type": "integer" }, "state": { "description": "State is pending (waits for your yes), active, paused or ended.", "type": "string" }, "wait": { "description": "Wait is what the model of a self-paced loop said it waits for.", "type": "string" } } }, "schema.ChatsLoopList": { "type": "object", "properties": { "loops": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsLoop" } } } }, "schema.ChatsLoopMark": { "type": "object", "properties": { "id": { "type": "string" }, "run": { "type": "integer" } } }, "schema.ChatsLoopRequest": { "type": "object", "properties": { "interval": { "description": "Interval is the time between runs, such as 30s, 5m or 2h. Leave it\nempty for a self-paced loop.", "type": "string" }, "prompt": { "description": "Prompt is plain text, or a skill: /skill-name and its words.", "type": "string" } } }, "schema.ChatsLoopStateRequest": { "type": "object", "properties": { "state": { "description": "State is paused or active. Making a pending loop active confirms it.", "type": "string" } } }, "schema.ChatsMCPAppCall": { "type": "object", "properties": { "arguments": { "description": "Arguments is a JSON object, at most 16 KiB.", "type": "object" }, "server": { "description": "Server is \"connector:\u003cid\u003e\" or the name of an MCP server of the chat's model.", "type": "string" }, "tool": { "description": "Tool is a tool of that server whose visibility includes \"app\".", "type": "string" } } }, "schema.ChatsMCPAppCallResult": { "type": "object", "properties": { "result": { "type": "object" } } }, "schema.ChatsMCPAppResource": { "type": "object", "properties": { "html": { "description": "HTML is the page. It must run in a sandboxed frame with no access to the\norigin of the interface.", "type": "string" }, "meta": { "description": "Meta is the ui metadata of the resource as the MCP Apps specification\nnames it, cleaned: csp (connectDomains, resourceDomains, frameDomains and\nbaseUriDomains hold only https or wss origins), permissions and prefersBorder.", "type": "object", "additionalProperties": {} }, "mime_type": { "type": "string" }, "uri": { "type": "string" } } }, "schema.ChatsMCPConnector": { "type": "object", "properties": { "args": { "type": "array", "items": { "type": "string" } }, "command": { "type": "string" }, "created": { "type": "string" }, "enabled": { "type": "boolean" }, "has_env": { "type": "boolean" }, "has_headers": { "type": "boolean" }, "has_token": { "type": "boolean" }, "id": { "type": "string" }, "name": { "type": "string" }, "transport": { "description": "http or stdio", "type": "string" }, "updated": { "type": "string" }, "url": { "type": "string" } } }, "schema.ChatsMCPConnectorList": { "type": "object", "properties": { "connectors": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsMCPConnector" } } } }, "schema.ChatsMCPConnectorSwitch": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "off": { "type": "boolean" }, "reason": { "type": "string" }, "usable": { "type": "boolean" } } }, "schema.ChatsMCPConnectorTest": { "type": "object", "properties": { "error": { "type": "string" }, "ok": { "type": "boolean" }, "tool_details": { "description": "ToolDetails is each tool with the description its server gives, in the\norder of tools.", "type": "array", "items": { "$ref": "#/definitions/schema.ChatsMCPConnectorTool" } }, "tools": { "type": "array", "items": { "type": "string" } } } }, "schema.ChatsMCPConnectorTool": { "type": "object", "properties": { "description": { "type": "string", "example": "Search the documentation." }, "name": { "type": "string", "example": "search" } } }, "schema.ChatsMCPConnectorWrite": { "type": "object", "properties": { "args": { "type": "array", "items": { "type": "string" } }, "command": { "type": "string" }, "enabled": { "type": "boolean" }, "env": { "type": "object", "additionalProperties": { "type": "string" } }, "headers": { "type": "object", "additionalProperties": { "type": "string" } }, "name": { "type": "string" }, "token": { "type": "string" }, "transport": { "type": "string" }, "url": { "type": "string" } } }, "schema.ChatsMCPContent": { "type": "object", "properties": { "text": { "type": "string" } } }, "schema.ChatsMCPPrompt": { "type": "object", "properties": { "arguments": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsMCPPromptArg" } }, "description": { "type": "string" }, "name": { "type": "string" }, "server": { "type": "string" }, "title": { "type": "string" } } }, "schema.ChatsMCPPromptArg": { "type": "object", "properties": { "description": { "type": "string" }, "name": { "type": "string" }, "required": { "type": "boolean" } } }, "schema.ChatsMCPPromptList": { "type": "object", "properties": { "prompts": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsMCPPrompt" } } } }, "schema.ChatsMCPPromptRequest": { "type": "object", "properties": { "arguments": { "type": "object", "additionalProperties": { "type": "string" } }, "name": { "type": "string" }, "server": { "type": "string" } } }, "schema.ChatsMCPReadRequest": { "type": "object", "properties": { "server": { "type": "string" }, "uri": { "type": "string" } } }, "schema.ChatsMCPRef": { "type": "object", "properties": { "arguments": { "type": "object", "additionalProperties": { "type": "string" } }, "name": { "type": "string" }, "server": { "type": "string" }, "uri": { "type": "string" } } }, "schema.ChatsMCPResource": { "type": "object", "properties": { "description": { "type": "string" }, "mime_type": { "type": "string" }, "name": { "type": "string" }, "server": { "type": "string" }, "uri": { "type": "string" } } }, "schema.ChatsMCPResourceList": { "type": "object", "properties": { "resources": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsMCPResource" } } } }, "schema.ChatsMCPServerSwitch": { "type": "object", "properties": { "name": { "type": "string" }, "off": { "type": "boolean" }, "reason": { "type": "string" }, "usable": { "type": "boolean" } } }, "schema.ChatsMCPSwitches": { "type": "object", "properties": { "off": { "type": "array", "items": { "type": "string" } } } }, "schema.ChatsMessage": { "type": "object", "properties": { "after": { "type": "integer" }, "app": { "description": "App is set on a tool line whose tool has an MCP App: the interactive page\nthat goes with the result.", "allOf": [ { "$ref": "#/definitions/schema.ChatsToolApp" } ] }, "at": { "type": "string" }, "attachments": { "description": "Attachments are the files of a user line.", "type": "array", "items": { "$ref": "#/definitions/schema.ChatsAttachment" } }, "before": { "description": "Before and After are the size of the model's context, in tokens, on a\ncompacted line.", "type": "integer" }, "card": { "description": "Card is set on a tool line that points at a record, such as a trigger\nproposal (kind trigger_proposal, id the proposal's id).", "allOf": [ { "$ref": "#/definitions/schema.ChatsToolCard" } ] }, "dur_ms": { "description": "DurMs is how long the model thought, for reasoning lines.", "type": "integer" }, "goal_event": { "description": "GoalEvent is set on a goal line: set, replaced, continue (a message the\nserver sent by itself to go on; Text is that message and GoalTurn its\nautomatic turn), paused (Text is the reason), resumed, done (Text is the\nsummary), blocked (Text is the reason) or cleared.", "type": "string" }, "goal_turn": { "type": "integer" }, "invoked": { "description": "Invoked is the skill or saved agent a user line was sent with.", "allOf": [ { "$ref": "#/definitions/schema.ChatsInvocation" } ] }, "loop": { "description": "Loop is set on a user line that a loop of the chat sent by itself.", "allOf": [ { "$ref": "#/definitions/schema.ChatsLoopMark" } ] }, "rev": { "description": "Rev is the change set of a checkpoint line, whose text lists the paths\nit changed inside your home, one a line. POST /api/chats/files/undo\n{rev} undoes it.", "type": "integer" }, "role": { "description": "user, assistant, tool, checkpoint, reasoning, compacted, cleared or goal", "type": "string" }, "seq": { "type": "integer" }, "text": { "description": "Text is what was written. For a user line it is the text you typed:\nthe files you attached are in Attachments.", "type": "string" }, "turn": { "type": "integer" } } }, "schema.ChatsMessageList": { "type": "object", "properties": { "messages": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsMessage" } } } }, "schema.ChatsMoveRequest": { "type": "object", "properties": { "from": { "type": "string" }, "to": { "type": "string" } } }, "schema.ChatsNotification": { "type": "object", "properties": { "body": { "type": "string" }, "created": { "type": "string" }, "id": { "type": "integer" }, "kind": { "type": "string" }, "link": { "type": "string" }, "read": { "type": "boolean" }, "source": { "type": "string" }, "status": { "type": "string" }, "title": { "type": "string" } } }, "schema.ChatsNotificationCount": { "type": "object", "properties": { "deleted": { "type": "integer" }, "unread": { "type": "integer" } } }, "schema.ChatsNotificationList": { "type": "object", "properties": { "notifications": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsNotification" } }, "total": { "description": "Total is how many notifications the user keeps, more than the list when a limit cut it.", "type": "integer" }, "unread": { "type": "integer" } } }, "schema.ChatsNotificationsDelete": { "type": "object", "properties": { "all": { "type": "boolean" }, "ids": { "type": "array", "items": { "type": "integer" } }, "read_only": { "type": "boolean" } } }, "schema.ChatsNotificationsRead": { "type": "object", "properties": { "all": { "type": "boolean" }, "ids": { "type": "array", "items": { "type": "integer" } } } }, "schema.ChatsPending": { "type": "object", "properties": { "attachments": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsAttachment" } }, "id": { "type": "string" }, "seq": { "type": "integer" }, "text": { "type": "string" } } }, "schema.ChatsPendingEdit": { "type": "object", "properties": { "text": { "type": "string" } } }, "schema.ChatsPushKey": { "type": "object", "properties": { "public_key": { "type": "string" } } }, "schema.ChatsPushSubscription": { "type": "object", "properties": { "endpoint": { "type": "string" }, "keys": { "type": "object", "properties": { "auth": { "type": "string" }, "p256dh": { "type": "string" } } } } }, "schema.ChatsPushUnsubscribe": { "type": "object", "properties": { "endpoint": { "type": "string" } } }, "schema.ChatsSearchHit": { "type": "object", "properties": { "document": { "description": "Document is true for a line of the text read from a PDF, Word, Excel or\nPowerPoint file. Line is then a line of that text.", "type": "boolean" }, "kind": { "type": "string" }, "line": { "type": "integer" }, "page": { "description": "Page, Sheet and Slide say where a document hit is, when the document has\npages, sheets or slides.", "type": "integer" }, "path": { "type": "string" }, "sheet": { "type": "string" }, "slide": { "type": "integer" }, "snippet": { "type": "string" } } }, "schema.ChatsSearchResult": { "type": "object", "properties": { "hits": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsSearchHit" } }, "indexing": { "description": "Indexing counts the documents below the path whose text is not read\nyet: the same search a moment later may find more.", "type": "integer" }, "limited": { "description": "Limited is set when the search stopped at one of its limits before it\nlooked at every file below the path: a file that matches may be\nmissing, so narrow the path or the query.", "type": "boolean" } } }, "schema.ChatsSendRequest": { "type": "object", "properties": { "agent": { "description": "Agent hands the task in Text to one of your saved agents (its id or\nname). The chat must have the saved agents switched on.", "type": "string" }, "context": { "description": "Context adds MCP prompts and resources to this message as context. Each\nis expanded on the server, as you, from a server the chat can use.", "type": "array", "items": { "$ref": "#/definitions/schema.ChatsMCPRef" } }, "skill": { "description": "Skill runs the message with one of the chat's skills: the model gets the\nskill's instructions with this message, and the transcript shows the\nskill's name next to the text. An unknown skill is refused with the names\nthe chat has. Text may then be empty.", "type": "string" }, "text": { "type": "string" } } }, "schema.ChatsSendResponse": { "type": "object", "properties": { "pending_id": { "type": "string" }, "started": { "type": "boolean" } } }, "schema.ChatsSettings": { "type": "object", "properties": { "context_size": { "description": "ContextSize is the context window in tokens that the loop plans with\n(when it compacts the conversation), 0 for the model's own.", "type": "integer" }, "reasoning_effort": { "description": "ReasoningEffort is none, minimal, low, medium or high.", "type": "string" }, "system_prompt": { "description": "SystemPrompt is added to the chat's instructions, before the saved agent's.", "type": "string" }, "temperature": { "description": "Temperature is between 0 and 2.", "type": "number" }, "top_k": { "type": "integer" }, "top_p": { "description": "TopP is above 0 and at most 1.", "type": "number" } } }, "schema.ChatsSkill": { "type": "object", "properties": { "addon": { "description": "Addon and AddonTitle name the add-on that provides a skill of the addon\nlayer.", "type": "string" }, "addon_title": { "type": "string" }, "description": { "type": "string" }, "editable": { "description": "Editable is true when you may change or delete it here.", "type": "boolean" }, "enabled": { "description": "Enabled is false when the chat has switched it off.", "type": "boolean" }, "fallback": { "description": "Fallback is set on a built-in skill that serves because the add-on\nskill that replaces it is off or not running in the chat: the title of\nthat add-on.", "type": "string" }, "id": { "description": "ID is \"layer:name\". A switch with the ID turns off the skill of that\nlayer; a switch with the plain name turns off the skill that wins.", "type": "string" }, "invalid": { "description": "Invalid says why a SKILL.md was skipped.", "type": "string" }, "layer": { "description": "Layer is where it comes from: folder (a .skills folder of your files),\npersonal, shared, addon (an installed add-on ships it) or builtin.", "type": "string" }, "name": { "type": "string" }, "path": { "description": "Path is the path of its SKILL.md as the model sees it.", "type": "string" }, "shadowed": { "description": "Shadowed names the layer of a nearer skill with the same name, which wins.", "type": "string" }, "shadowed_by": { "description": "ShadowedBy is the add-on whose skill wins over this one, when the\nwinner ships with an add-on (a built-in skill an add-on replaces, or\nthe skill of an add-on that is not the chosen one).", "type": "string" } } }, "schema.ChatsSkillDetail": { "type": "object", "properties": { "body": { "type": "string" }, "description": { "type": "string" }, "editable": { "type": "boolean" }, "layer": { "type": "string" }, "name": { "type": "string" } } }, "schema.ChatsSkillList": { "type": "object", "properties": { "notes": { "description": "Notes say what could not be read or searched.", "type": "array", "items": { "type": "string" } }, "skills": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsSkill" } } } }, "schema.ChatsSkillSwitches": { "type": "object", "properties": { "off": { "type": "array", "items": { "type": "string" } } } }, "schema.ChatsSkillUpdate": { "type": "object", "properties": { "body": { "type": "string" }, "description": { "type": "string" } } }, "schema.ChatsSkillWrite": { "type": "object", "properties": { "body": { "type": "string" }, "description": { "type": "string" }, "layer": { "description": "personal or shared", "type": "string" }, "name": { "type": "string" } } }, "schema.ChatsSubAgent": { "type": "object", "properties": { "created": { "type": "string" }, "id": { "type": "string" }, "last_turn": { "type": "string" }, "running": { "description": "Running is true while the run's turn is going. LastTurn is how its last\nturn ended: done, stopped, failed, interrupted or paused.", "type": "boolean" }, "title": { "type": "string" }, "updated": { "type": "string" } } }, "schema.ChatsSubAgentList": { "type": "object", "properties": { "background_limit": { "description": "BackgroundLimit is how many a chat may run in the background at once.", "type": "integer" }, "running": { "description": "Running is how many of them run now, on any frontend of the server.", "type": "integer" }, "sub_agents": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsSubAgent" } } } }, "schema.ChatsSwitches": { "type": "object", "properties": { "addons_off": { "type": "array", "items": { "type": "string" } }, "builtins_off": { "type": "array", "items": { "type": "string" } }, "builtins_on": { "type": "array", "items": { "type": "string" } }, "mcp_off": { "type": "array", "items": { "type": "string" } }, "skills_off": { "type": "array", "items": { "type": "string" } } } }, "schema.ChatsToolApp": { "type": "object", "properties": { "cut": { "description": "Cut says that the input or the result was too large and is left out.", "type": "boolean" }, "input": { "description": "Input is the arguments of the call, at most 16 KiB.", "type": "object" }, "resource_uri": { "description": "ResourceURI is the ui:// resource that holds the page.", "type": "string" }, "result": { "description": "Result is the full MCP result of the call, at most 256 KiB.", "type": "object" }, "server": { "description": "Server is \"connector:\u003cid\u003e\" for one of your connectors, or the name of an\nMCP server of the model.", "type": "string" }, "tool": { "description": "Tool is the name of the tool on that server.", "type": "string" }, "visibility": { "description": "Visibility is who may call the tool: \"model\", \"app\" or both.", "type": "array", "items": { "type": "string" } } } }, "schema.ChatsToolCard": { "type": "object", "properties": { "file_kind": { "description": "FileKind is the kind, \"deliverable\" or \"working\", of the file that a\nfiles_change card names in its id (see ChatsChatFile.Kind).", "type": "string" }, "files": { "description": "Files are the files in your home that a command (bash) created,\nchanged or deleted, on the card of that call. Paths are inside your\nhome, which is \"/\". FilesMore counts the files the card does not list.", "type": "array", "items": { "$ref": "#/definitions/schema.ChatsToolFile" } }, "files_more": { "type": "integer" }, "id": { "type": "string" }, "kind": { "type": "string" } } }, "schema.ChatsToolEvent": { "type": "object", "properties": { "app": { "description": "App is the reference of the MCP App of the call, on tool_end. It has no\ninput and no result: read the transcript line for them.", "allOf": [ { "$ref": "#/definitions/schema.ChatsToolApp" } ] }, "card": { "description": "Card is the record the result points at, on tool_end; see ChatsMessage.", "allOf": [ { "$ref": "#/definitions/schema.ChatsToolCard" } ] }, "name": { "type": "string" }, "ok": { "type": "boolean" }, "output": { "type": "string" }, "seq": { "description": "Seq is the sequence number of the call's transcript line, on tool_end. A\nclient that wants the app's input and result reads that one line with\nGET /api/chats/{id}/messages?after=\u003cseq-1\u003e\u0026limit=1.", "type": "integer" }, "summary": { "type": "string" } } }, "schema.ChatsToolFallback": { "type": "object", "properties": { "addon": { "description": "Addon and AddonTitle name the add-on that would serve it: the one an\nadministrator chose, or the one installed first.", "type": "string", "example": "sandbox" }, "addon_title": { "type": "string", "example": "Sandbox" }, "builtin": { "description": "Builtin says that the built-in tool serves instead; false when the\nbuilt-in is off too, so the chat has no such tool.", "type": "boolean" }, "tool": { "description": "Tool is the built-in tool, such as bash.", "type": "string", "example": "bash" } } }, "schema.ChatsToolFile": { "type": "object", "properties": { "kind": { "description": "Kind is \"deliverable\" or \"working\" (see ChatsChatFile.Kind).", "type": "string" }, "op": { "description": "Op is created, changed or deleted.", "type": "string" }, "path": { "type": "string" }, "rev": { "description": "Rev is the change set that last touched the file in this call.", "type": "integer" } } }, "schema.ChatsToolsPanel": { "type": "object", "properties": { "addons": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsAddon" } }, "builtins": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsBuiltinGroup" } }, "connectors": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsMCPConnectorSwitch" } }, "fallbacks": { "description": "Fallbacks are the built-in tools that an installed add-on replaces but\nthat no add-on serves in this chat now: the add-on is stopped, off for\nthe chat, not granted by its agent, or cannot run.", "type": "array", "items": { "$ref": "#/definitions/schema.ChatsToolFallback" } }, "off": { "description": "Off is the list of MCP switches in force.", "type": "array", "items": { "type": "string" } }, "servers": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsMCPServerSwitch" } } } }, "schema.ChatsTrash": { "type": "object", "properties": { "entries": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsTrashEntry" } }, "totals": { "description": "Totals counts everything in the Trash, also what a long list leaves out.\nIt is what \"empty the Trash\" removes.", "allOf": [ { "$ref": "#/definitions/schema.ChatsTrashTotals" } ] } } }, "schema.ChatsTrashEntry": { "type": "object", "properties": { "at": { "type": "string" }, "bytes": { "type": "integer" }, "files": { "description": "Files, Folders and Bytes say what deleting the entry for good removes.", "type": "integer" }, "folders": { "type": "integer" }, "paths": { "type": "array", "items": { "type": "string" } }, "rev": { "type": "integer" }, "title": { "type": "string" } } }, "schema.ChatsTrashTotals": { "type": "object", "properties": { "bytes": { "type": "integer" }, "files": { "type": "integer" }, "folders": { "type": "integer" } } }, "schema.ChatsTrigger": { "type": "object", "properties": { "agent_id": { "type": "string" }, "cost": { "$ref": "#/definitions/schema.ChatsTriggerCost" }, "daily_cap": { "type": "integer" }, "enabled": { "type": "boolean" }, "folder": { "type": "string" }, "id": { "type": "string" }, "kind": { "type": "string" }, "last_done": { "type": "string" }, "last_run": { "description": "LastRun is the newest run, if any, and LastDone the end of the newest\nrun that finished without an error.", "allOf": [ { "$ref": "#/definitions/schema.ChatsTriggerRun" } ] }, "min_gap_seconds": { "description": "MinGapSeconds is the shortest time between two runs of a file trigger.", "type": "integer" }, "model": { "type": "string" }, "name": { "type": "string" }, "next_run": { "type": "string" }, "plan": { "description": "Plan says what a run reads and writes and which Home widget shows the\nfile it writes; Cost what a run costs.", "allOf": [ { "$ref": "#/definitions/schema.ChatsTriggerPlan" } ] }, "prompt": { "type": "string" }, "quiet_seconds": { "type": "integer" }, "schedule": { "type": "string" }, "source_chat_id": { "type": "string" }, "summary": { "description": "Summary says when it runs in plain words. NextRun is set for a schedule\ntrigger that is on.", "type": "string" }, "time_zone": { "type": "string" } } }, "schema.ChatsTriggerChange": { "type": "object", "properties": { "after": { "$ref": "#/definitions/schema.ChatsTrigger" }, "answered_at": { "type": "string" }, "before": { "$ref": "#/definitions/schema.ChatsTrigger" }, "can_undo": { "type": "boolean" }, "fields": { "type": "array", "items": { "type": "string" } }, "id": { "type": "string" }, "last_run": { "$ref": "#/definitions/schema.ChatsTriggerRun" }, "op": { "type": "string" }, "stale": { "type": "boolean" }, "state": { "type": "string" }, "trigger_id": { "type": "string" }, "undo_blocked": { "type": "string" } } }, "schema.ChatsTriggerConfirm": { "type": "object", "properties": { "time_zone": { "type": "string" } } }, "schema.ChatsTriggerCost": { "type": "object", "properties": { "average_tokens": { "description": "AverageTokens is the mean of the last finished runs that reported their\ntokens, and Runs how many runs that is.", "type": "integer" }, "estimated_tokens": { "description": "EstimatedTokens is the estimate of the proposal; 0 is unknown.", "type": "integer" }, "max_runs_per_day": { "description": "MaxRunsPerDay is the most runs one day can have: the daily limit, or\nfewer when the schedule runs less often.", "type": "integer" }, "remote": { "description": "Remote is true when the model runs on a remote service, so the tokens\nleave this server.", "type": "boolean" }, "runs": { "type": "integer" } } }, "schema.ChatsTriggerList": { "type": "object", "properties": { "triggers": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsTrigger" } } } }, "schema.ChatsTriggerPlan": { "type": "object", "properties": { "reads": { "type": "string" }, "widget": { "description": "Widget is the id of the Home widget in home.json that shows Writes.", "type": "string" }, "writes": { "description": "Writes is a path in the owner's home, such as data/inbox.json.", "type": "string" } } }, "schema.ChatsTriggerPreview": { "type": "object", "properties": { "summary": { "type": "string" }, "times": { "type": "array", "items": { "type": "string" } } } }, "schema.ChatsTriggerProposal": { "type": "object", "properties": { "answered_at": { "type": "string" }, "can_undo": { "type": "boolean" }, "state": { "type": "string" }, "trigger": { "$ref": "#/definitions/schema.ChatsTrigger" }, "undo_blocked": { "type": "string" } } }, "schema.ChatsTriggerRun": { "type": "object", "properties": { "chat_id": { "type": "string" }, "due": { "type": "string" }, "ended": { "type": "string" }, "file": { "type": "string" }, "id": { "type": "string" }, "reason": { "type": "string" }, "started": { "type": "string" }, "status": { "type": "string" }, "tokens": { "description": "Tokens is what the run's model requests used, when it is known.", "type": "integer" } } }, "schema.ChatsTriggerRunList": { "type": "object", "properties": { "runs": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsTriggerRun" } } } }, "schema.ChatsTriggerWrite": { "type": "object", "properties": { "agent_id": { "description": "AgentID is optional. Model is needed when neither the agent nor the source\nchat names one.", "type": "string" }, "daily_cap": { "type": "integer" }, "enabled": { "type": "boolean" }, "estimated_tokens": { "description": "EstimatedTokens is about how many tokens one run uses; 0 keeps the\ntrigger's value.", "type": "integer" }, "folder": { "type": "string" }, "kind": { "type": "string" }, "min_gap_seconds": { "description": "MinGapSeconds is the shortest time between two runs of a file trigger;\n0 keeps the trigger's value (one minute for a new one).", "type": "integer" }, "model": { "type": "string" }, "name": { "type": "string" }, "plan": { "description": "Plan describes the runs. An empty field keeps the trigger's value.", "allOf": [ { "$ref": "#/definitions/schema.ChatsTriggerPlan" } ] }, "prompt": { "type": "string" }, "quiet_seconds": { "type": "integer" }, "schedule": { "type": "string" }, "source_chat_id": { "type": "string" }, "time_zone": { "type": "string" } } }, "schema.ChatsUndoRequest": { "type": "object", "properties": { "rev": { "type": "integer" }, "skip_conflicts": { "type": "boolean" } } }, "schema.ChatsUndoResponse": { "type": "object", "properties": { "conflicts": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsFileConflict" } }, "rev": { "type": "integer" } } }, "schema.ChatsUpdateRequest": { "type": "object", "properties": { "model": { "description": "Model moves the chat to another model; the history stays.", "type": "string" }, "settings": { "description": "Settings replaces the chat's settings as a whole.", "allOf": [ { "$ref": "#/definitions/schema.ChatsSettings" } ] }, "title": { "type": "string" } } }, "schema.ChatsUsage": { "type": "object", "properties": { "completion": { "description": "Completion is the number of tokens the request generated.", "type": "integer" }, "limit": { "description": "Limit is the context window the loop plans with, 0 when it is not known.", "type": "integer" }, "model": { "description": "Model is the model the request used.", "type": "string" }, "node": { "description": "Node is the worker node that served the request. It is set only when\nthe server exposes the node header (--expose-node-header).", "type": "string" }, "prompt_ms": { "description": "PromptMs is the time the backend took to read the prompt, in\nmilliseconds, when the backend reports it.", "type": "number" }, "tokens_per_second": { "description": "TokensPerSecond is the generation speed, 0 when the backend gave no timing.", "type": "number" }, "used": { "description": "Used is the number of tokens in the context the request sent.", "type": "integer" } } }, "schema.ChatsWebProviderTest": { "type": "object", "properties": { "host": { "type": "string", "example": "duckduckgo.com" }, "name": { "type": "string", "example": "duckduckgo" }, "outcome": { "description": "Outcome is ok, no_results, challenged (a bot check), blocked (403 or\n429), timeout or error.", "type": "string", "example": "challenged" }, "reason": { "type": "string", "example": "challenged by a bot check" }, "results": { "type": "integer" } } }, "schema.ChatsWebResult": { "type": "object", "properties": { "snippet": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" } } }, "schema.ChatsWebTestRequest": { "type": "object", "properties": { "query": { "type": "string", "example": "LocalAI" } } }, "schema.ChatsWebTestResponse": { "type": "object", "properties": { "error": { "type": "string" }, "host": { "type": "string", "example": "duckduckgo.com" }, "ok": { "type": "boolean" }, "provider": { "type": "string", "example": "duckduckgo" }, "providers": { "description": "Providers says what each provider of the order did with the query, in\norder: every provider is asked, so the administrator sees which work.", "type": "array", "items": { "$ref": "#/definitions/schema.ChatsWebProviderTest" } }, "results": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsWebResult" } } } }, "schema.ChatsWellKnownError": { "type": "object", "properties": { "current": { "$ref": "#/definitions/schema.ChatsWellKnownFile" }, "error": { "$ref": "#/definitions/schema.APIError" }, "errors": { "type": "array", "items": { "type": "string" } } } }, "schema.ChatsWellKnownFile": { "type": "object", "properties": { "data": { "description": "Data is the file when it is valid, its last valid version when it is\nnot (fallback is then true), or an empty object.", "type": "object", "additionalProperties": {} }, "errors": { "type": "array", "items": { "type": "string" } }, "exists": { "type": "boolean" }, "fallback": { "type": "boolean" }, "fallback_rev": { "type": "integer" }, "name": { "type": "string" }, "path": { "type": "string" }, "prefilled": { "description": "Prefilled names the keys of data that do not come from the file, and\nwhere they come from (\"account\").", "type": "object", "additionalProperties": { "type": "string" } }, "rev": { "type": "integer" }, "valid": { "description": "Valid is false when the file breaks its schema; errors says why.", "type": "boolean" }, "version": { "description": "Version is what a write sends back in If-Match. It is 0 when the file\ndoes not exist.", "type": "integer" } } }, "schema.ChatsWellKnownRevert": { "type": "object", "properties": { "rev": { "type": "integer" } } }, "schema.ChatsWellKnownVersion": { "type": "object", "properties": { "at": { "type": "string" }, "chat": { "description": "Chat is the chat that wrote it, and ChatTitle its title when it still exists.", "type": "string" }, "chat_title": { "type": "string" }, "data": { "type": "object", "additionalProperties": {} }, "errors": { "type": "array", "items": { "type": "string" } }, "kind": { "description": "Kind says who made it: user (you, in a form or the Files page), agent\n(the assistant), upload or undo.", "type": "string" }, "rev": { "type": "integer" }, "valid": { "type": "boolean" } } }, "schema.ChatsWellKnownVersions": { "type": "object", "properties": { "versions": { "type": "array", "items": { "$ref": "#/definitions/schema.ChatsWellKnownVersion" } } } }, "schema.ChatsWellKnownWrite": { "type": "object", "properties": { "replace": { "type": "boolean" }, "values": { "type": "object", "additionalProperties": {} } } }, "schema.Choice": { "type": "object", "properties": { "delta": { "$ref": "#/definitions/schema.Message" }, "finish_reason": { "type": "string" }, "index": { "type": "integer" }, "logprobs": { "$ref": "#/definitions/schema.Logprobs" }, "message": { "$ref": "#/definitions/schema.Message" }, "text": { "type": "string" } } }, "schema.CollectionCreateRequest": { "type": "object", "properties": { "name": { "type": "string" } } }, "schema.CollectionEntries": { "type": "object", "properties": { "count": { "type": "integer" }, "entries": { "type": "array", "items": { "type": "string" } } } }, "schema.CollectionEntryContent": { "type": "object", "properties": { "chunk_count": { "type": "integer" }, "content": { "type": "string" } } }, "schema.CollectionEntryDeleteRequest": { "type": "object", "properties": { "entry": { "type": "string" } } }, "schema.CollectionEntryDeleteResponse": { "type": "object", "properties": { "count": { "type": "integer" }, "remaining_entries": { "type": "array", "items": { "type": "string" } } } }, "schema.CollectionGroup": { "type": "object", "properties": { "collections": { "type": "array", "items": { "type": "string" } } } }, "schema.CollectionHit": { "type": "object", "properties": { "content": { "type": "string" }, "id": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "similarity": { "type": "number" } } }, "schema.CollectionList": { "type": "object", "properties": { "collections": { "type": "array", "items": { "type": "string" } }, "count": { "type": "integer" }, "embedding_model": { "description": "EmbeddingModel is the model that indexes and searches the collections.\nEmbeddingModelInstalled is false when this server does not have it:\nadding files and searching then fail until it is installed.", "type": "string" }, "embedding_model_installed": { "type": "boolean" }, "user_groups": { "description": "UserGroups holds the collections of the other users. Only an administrator\nwho asks for all users gets it.", "type": "object", "additionalProperties": { "$ref": "#/definitions/schema.CollectionGroup" } } } }, "schema.CollectionSearchRequest": { "type": "object", "properties": { "max_results": { "description": "MaxResults is how many passages to return. A value below 1 picks a\ndefault, and a value above the number of stored passages returns them all.", "type": "integer" }, "query": { "type": "string" } } }, "schema.CollectionSearchResponse": { "type": "object", "properties": { "count": { "type": "integer" }, "results": { "type": "array", "items": { "$ref": "#/definitions/schema.CollectionHit" } } } }, "schema.CollectionSource": { "type": "object", "properties": { "last_update": { "type": "string" }, "update_interval": { "type": "integer" }, "url": { "type": "string" } } }, "schema.CollectionSourceRequest": { "type": "object", "properties": { "update_interval": { "description": "UpdateInterval is the minutes between two fetches. Default 60.", "type": "integer" }, "url": { "type": "string" } } }, "schema.CollectionSources": { "type": "object", "properties": { "count": { "type": "integer" }, "sources": { "type": "array", "items": { "$ref": "#/definitions/schema.CollectionSource" } } } }, "schema.CollectionStatus": { "type": "object", "properties": { "filename": { "type": "string" }, "key": { "description": "Key names the new entry.", "type": "string" }, "name": { "type": "string" }, "status": { "type": "string" } } }, "schema.CompressionMetadata": { "type": "object", "properties": { "compressed_tokens": { "type": "integer" }, "compressor": { "type": "string" }, "dropped_turns": { "type": "integer" }, "original_tokens": { "type": "integer" }, "overflow_recoveries": { "type": "integer" }, "summary_tokens": { "type": "integer" } } }, "schema.DecisionAnswer": { "type": "object", "properties": { "choice": { "description": "Choice preserves the selected string or boolean value. Swagger 2 uses a loose object placeholder for this union.", "type": "object" }, "confidence": { "type": "number" }, "name": { "type": "string" }, "probabilities": { "type": "array", "items": { "$ref": "#/definitions/schema.DecisionProbability" } }, "probability": { "type": "number" }, "score": { "type": "number" }, "type": { "type": "string" } } }, "schema.DecisionChoice": { "type": "object", "properties": { "description": { "type": "string" }, "value": { "description": "Value is a string or boolean choice. Swagger 2 uses a loose object placeholder for this union.", "type": "object" } } }, "schema.DecisionLevel": { "type": "object", "properties": { "description": { "type": "string" }, "label": { "type": "string" } } }, "schema.DecisionProbability": { "type": "object", "properties": { "label": { "type": "string" }, "probability": { "type": "number" }, "value": { "description": "Value is a string or boolean for choices, or a zero-based integer for score levels. Swagger 2 uses a loose object placeholder for this union.", "type": "object" } } }, "schema.DecisionQuestion": { "type": "object", "properties": { "choices": { "type": "array", "items": { "$ref": "#/definitions/schema.DecisionChoice" } }, "instructions": { "type": "string" }, "levels": { "type": "array", "items": { "$ref": "#/definitions/schema.DecisionLevel" } }, "name": { "type": "string" }, "type": { "type": "string" } } }, "schema.DecisionUsage": { "type": "object", "properties": { "input_tokens": { "type": "integer" }, "input_tokens_details": { "type": "object", "additionalProperties": { "type": "integer" } }, "output_tokens": { "type": "integer" }, "output_tokens_details": { "type": "object", "additionalProperties": { "type": "integer" } }, "total_tokens": { "type": "integer" } } }, "schema.DecisionsRequest": { "type": "object", "properties": { "input": { "description": "Input is a text string or an array of user messages. Swagger 2 uses a loose object placeholder for this union.", "type": "object" }, "model": { "type": "string" }, "questions": { "type": "array", "items": { "$ref": "#/definitions/schema.DecisionQuestion" } }, "safety_identifier": { "type": "string" } } }, "schema.DecisionsResponse": { "type": "object", "properties": { "answers": { "type": "array", "items": { "$ref": "#/definitions/schema.DecisionAnswer" } }, "model": { "type": "string" }, "usage": { "$ref": "#/definitions/schema.DecisionUsage" } } }, "schema.DepthRequest": { "type": "object", "properties": { "dst": { "description": "optional output directory for exports (glb/colmap)", "type": "string" }, "exports": { "description": "requested exports: \"glb\", \"colmap\"", "type": "array", "items": { "type": "string" } }, "image": { "description": "URL or base64-encoded image to analyze", "type": "string" }, "include_confidence": { "description": "return the per-pixel confidence map (DualDPT)", "type": "boolean" }, "include_depth": { "description": "return the per-pixel depth map", "type": "boolean" }, "include_points": { "description": "back-project to a 3D point cloud (DualDPT)", "type": "boolean" }, "include_pose": { "description": "return camera extrinsics/intrinsics (DualDPT)", "type": "boolean" }, "include_sky": { "description": "return the per-pixel sky map (mono models)", "type": "boolean" }, "model": { "type": "string" }, "points_conf_thresh": { "description": "keep points with confidence \u003e= this threshold", "type": "number" } } }, "schema.DepthResponse": { "type": "object", "properties": { "confidence": { "description": "width*height row-major confidence (DualDPT)", "type": "array", "items": { "type": "number" } }, "depth": { "description": "width*height row-major metric depth", "type": "array", "items": { "type": "number" } }, "export_paths": { "description": "paths written for the requested exports", "type": "array", "items": { "type": "string" } }, "extrinsics": { "description": "12 floats, 3x4 row-major (world-to-camera)", "type": "array", "items": { "type": "number" } }, "height": { "type": "integer" }, "intrinsics": { "description": "9 floats, 3x3 row-major", "type": "array", "items": { "type": "number" } }, "is_metric": { "description": "depth is in metric units", "type": "boolean" }, "num_points": { "description": "number of 3D points", "type": "integer" }, "point_colors": { "description": "base64-encoded num_points*3 uint8 rgb", "type": "string" }, "points": { "description": "num_points*3 xyz, world space", "type": "array", "items": { "type": "number" } }, "sky": { "description": "width*height row-major sky map (mono)", "type": "array", "items": { "type": "number" } }, "width": { "type": "integer" } } }, "schema.Detection": { "type": "object", "properties": { "class_name": { "type": "string" }, "confidence": { "type": "number" }, "height": { "type": "number" }, "mask": { "description": "base64-encoded PNG segmentation mask", "type": "string" }, "width": { "type": "number" }, "x": { "type": "number" }, "y": { "type": "number" } } }, "schema.DetectionRequest": { "type": "object", "properties": { "boxes": { "description": "Box coordinates as [x1,y1,x2,y2,...] quads", "type": "array", "items": { "type": "number" } }, "image": { "description": "URL or base64-encoded image to analyze", "type": "string" }, "model": { "type": "string" }, "points": { "description": "Point coordinates as [x,y,label,...] triples (label: 1=pos, 0=neg)", "type": "array", "items": { "type": "number" } }, "prompt": { "description": "Text prompt (for SAM 3 PCS mode)", "type": "string" }, "threshold": { "description": "Detection confidence threshold", "type": "number" } } }, "schema.DetectionResponse": { "type": "object", "properties": { "detections": { "type": "array", "items": { "$ref": "#/definitions/schema.Detection" } } } }, "schema.DetokenizeRequest": { "type": "object", "properties": { "model": { "type": "string" }, "tokens": { "description": "token IDs to convert back to text", "type": "array", "items": { "type": "integer" } } } }, "schema.DetokenizeResponse": { "type": "object", "properties": { "content": { "description": "detokenized text", "type": "string" } } }, "schema.DiarizationResult": { "type": "object", "properties": { "duration": { "type": "number" }, "language": { "type": "string" }, "num_speakers": { "type": "integer" }, "segments": { "type": "array", "items": { "$ref": "#/definitions/schema.DiarizationSegment" } }, "sounds": { "description": "Sounds is present only when the request set include_sounds. An empty\nlist then means the model ran and heard no event; omitzero keeps a nil\nlist (not requested) out of the payload while an empty one stays.", "type": "array", "items": { "$ref": "#/definitions/schema.DiarizationSound" } }, "speaker_profiles": { "$ref": "#/definitions/schema.SpeakerProfiles" }, "speakers": { "type": "array", "items": { "$ref": "#/definitions/schema.DiarizationSpeaker" } }, "task": { "type": "string" } } }, "schema.DiarizationSegment": { "type": "object", "properties": { "end": { "type": "number" }, "id": { "type": "integer" }, "label": { "type": "string" }, "name": { "description": "Name is the registered speaker this segment was matched to, and NameScore\nthe cosine similarity of the match. Both are omitted when the backend did\nnot identify the speaker. Speaker stays the normalized SPEAKER_NN label.", "type": "string" }, "name_score": { "type": "number" }, "speaker": { "type": "string" }, "start": { "type": "number" }, "text": { "type": "string" } } }, "schema.DiarizationSound": { "type": "object", "properties": { "confidence": { "type": "number" }, "end": { "type": "number" }, "label": { "type": "string" }, "start": { "type": "number" } } }, "schema.DiarizationSpeaker": { "type": "object", "properties": { "id": { "type": "string" }, "label": { "type": "string" }, "name": { "type": "string" }, "segment_count": { "type": "integer" }, "total_speech_duration": { "type": "number" } } }, "schema.ElevenLabsSoundGenerationRequest": { "type": "object", "properties": { "bpm": { "type": "integer" }, "caption": { "type": "string" }, "do_sample": { "type": "boolean" }, "duration_seconds": { "type": "number" }, "expansion_model": { "type": "string" }, "instrumental": { "description": "Simple mode: use text as description; optional instrumental / vocal_language", "type": "boolean" }, "keyscale": { "type": "string" }, "language": { "type": "string" }, "lyrics": { "type": "string" }, "model_id": { "type": "string" }, "params": { "type": "object", "additionalProperties": { "type": "string" } }, "prompt_influence": { "type": "number" }, "text": { "type": "string" }, "think": { "description": "Advanced mode", "type": "boolean" }, "timesignature": { "type": "string" }, "vocal_language": { "type": "string" } } }, "schema.ErrorResponse": { "type": "object", "properties": { "error": { "$ref": "#/definitions/schema.APIError" } } }, "schema.FaceAnalysis": { "type": "object", "properties": { "age": { "type": "number" }, "antispoof_score": { "type": "number" }, "dominant_emotion": { "type": "string" }, "dominant_gender": { "type": "string" }, "dominant_race": { "type": "string" }, "emotion": { "type": "object", "additionalProperties": { "type": "number", "format": "float32" } }, "face_confidence": { "type": "number" }, "gender": { "type": "object", "additionalProperties": { "type": "number", "format": "float32" } }, "is_real": { "description": "Liveness fields — see FaceVerifyResponse for why these are pointers.", "type": "boolean" }, "race": { "type": "object", "additionalProperties": { "type": "number", "format": "float32" } }, "region": { "$ref": "#/definitions/schema.FacialArea" } } }, "schema.FaceAnalyzeRequest": { "type": "object", "properties": { "actions": { "description": "subset of {\"age\",\"gender\",\"emotion\",\"race\"}", "type": "array", "items": { "type": "string" } }, "anti_spoofing": { "type": "boolean" }, "img": { "type": "string" }, "model": { "type": "string" } } }, "schema.FaceAnalyzeResponse": { "type": "object", "properties": { "faces": { "type": "array", "items": { "$ref": "#/definitions/schema.FaceAnalysis" } } } }, "schema.FaceEmbedRequest": { "type": "object", "properties": { "img": { "type": "string" }, "model": { "type": "string" } } }, "schema.FaceEmbedResponse": { "type": "object", "properties": { "dim": { "type": "integer" }, "embedding": { "type": "array", "items": { "type": "number" } }, "model": { "type": "string" } } }, "schema.FaceForgetRequest": { "type": "object", "properties": { "id": { "type": "string" }, "model": { "type": "string" }, "store": { "type": "string" } } }, "schema.FaceIdentifyMatch": { "type": "object", "properties": { "confidence": { "type": "number" }, "distance": { "type": "number" }, "id": { "type": "string" }, "labels": { "type": "object", "additionalProperties": { "type": "string" } }, "match": { "description": "true when distance \u003c= threshold", "type": "boolean" }, "name": { "type": "string" } } }, "schema.FaceIdentifyRequest": { "type": "object", "properties": { "img": { "type": "string" }, "model": { "type": "string" }, "store": { "type": "string" }, "threshold": { "description": "optional cutoff on distance", "type": "number" }, "top_k": { "type": "integer" } } }, "schema.FaceIdentifyResponse": { "type": "object", "properties": { "matches": { "type": "array", "items": { "$ref": "#/definitions/schema.FaceIdentifyMatch" } } } }, "schema.FaceRegisterRequest": { "type": "object", "properties": { "embedding": { "type": "array", "items": { "type": "number" } }, "img": { "type": "string" }, "labels": { "type": "object", "additionalProperties": { "type": "string" } }, "model": { "type": "string" }, "name": { "type": "string" }, "registered_at": { "description": "original enrollment time when replaying a saved embedding", "type": "string" }, "store": { "description": "vector store model; empty = local-store default", "type": "string" } } }, "schema.FaceRegisterResponse": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "registered_at": { "type": "string" } } }, "schema.FaceVerifyRequest": { "type": "object", "properties": { "anti_spoofing": { "type": "boolean" }, "img1": { "type": "string" }, "img2": { "type": "string" }, "model": { "type": "string" }, "threshold": { "type": "number" } } }, "schema.FaceVerifyResponse": { "type": "object", "properties": { "confidence": { "type": "number" }, "distance": { "type": "number" }, "img1_antispoof_score": { "type": "number" }, "img1_area": { "$ref": "#/definitions/schema.FacialArea" }, "img1_is_real": { "description": "Liveness fields are only populated when the request set\nanti_spoofing=true. Pointers keep them fully absent from the\nJSON response otherwise, so callers can tell \"not checked\"\napart from \"checked and fake\" (which would collapse to zero\nvalues with plain bool+omitempty).", "type": "boolean" }, "img2_antispoof_score": { "type": "number" }, "img2_area": { "$ref": "#/definitions/schema.FacialArea" }, "img2_is_real": { "type": "boolean" }, "model": { "type": "string" }, "processing_time_ms": { "type": "number" }, "threshold": { "type": "number" }, "verified": { "type": "boolean" } } }, "schema.FacialArea": { "type": "object", "properties": { "h": { "type": "number" }, "w": { "type": "number" }, "x": { "type": "number" }, "y": { "type": "number" } } }, "schema.ForecastRequest": { "type": "object", "properties": { "clip_nonnegative": { "description": "null = model default", "type": "boolean" }, "max_context": { "description": "cap on history used; 0 = model default", "type": "integer" }, "model": { "type": "string" }, "prediction_length": { "description": "steps to forecast", "type": "integer" }, "quantiles": { "description": "levels to return; default 0.1, 0.5, 0.9", "type": "array", "items": { "type": "number" } }, "series": { "type": "array", "items": { "$ref": "#/definitions/schema.ForecastSeries" } }, "symmetric_averaging": { "description": "null = model default", "type": "boolean" } } }, "schema.ForecastResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/schema.ForecastSeriesResult" } }, "model": { "type": "string" }, "object": { "type": "string" }, "prediction_length": { "type": "integer" }, "quantile_levels": { "type": "array", "items": { "type": "number" } } } }, "schema.ForecastSeries": { "type": "object", "properties": { "id": { "description": "echoed back in the matching result", "type": "string" }, "known_categorical": { "description": "KnownCategorical is [C][T+H]: integer category codes for the future too.", "type": "array", "items": { "type": "array", "items": { "type": "number", "format": "float64" } } }, "known_covariates": { "description": "KnownCovariates is [C][T+H]: numeric covariates known for the future too.", "type": "array", "items": { "type": "array", "items": { "type": "number", "format": "float64" } } }, "past_categorical": { "description": "PastCategorical is [C][T]: integer category codes for the past.", "type": "array", "items": { "type": "array", "items": { "type": "number", "format": "float64" } } }, "past_covariates": { "description": "PastCovariates is [C][T]: numeric covariates known only for the past.", "type": "array", "items": { "type": "array", "items": { "type": "number", "format": "float64" } } }, "target": { "description": "[V][T] or [T], null = missing", "type": "array", "items": { "type": "array", "items": { "type": "number", "format": "float64" } } } } }, "schema.ForecastSeriesResult": { "type": "object", "properties": { "id": { "type": "string" }, "index": { "description": "position of the series in the request", "type": "integer" }, "variates": { "type": "array", "items": { "$ref": "#/definitions/schema.ForecastVariate" } } } }, "schema.ForecastVariate": { "type": "object", "properties": { "index": { "type": "integer" }, "values": { "description": "Values is [Q][H]: Values[q][h] is quantile_levels[q] at step h.", "type": "array", "items": { "type": "array", "items": { "type": "number", "format": "float32" } } } } }, "schema.FunctionCall": { "type": "object", "properties": { "arguments": { "type": "string" }, "name": { "type": "string" } } }, "schema.GalleryResponse": { "type": "object", "properties": { "estimated_size_bytes": { "type": "integer" }, "estimated_size_display": { "type": "string" }, "estimated_vram_bytes": { "type": "integer" }, "estimated_vram_display": { "type": "string" }, "status": { "type": "string" }, "uuid": { "type": "string" } } }, "schema.InputTokensDetails": { "type": "object", "properties": { "image_tokens": { "type": "integer" }, "text_tokens": { "type": "integer" } } }, "schema.Item": { "type": "object", "properties": { "b64_json": { "type": "string" }, "index": { "type": "integer" }, "object": { "type": "string" }, "url": { "description": "Images", "type": "string" } } }, "schema.JINADocumentResult": { "type": "object", "properties": { "document": { "$ref": "#/definitions/schema.JINAText" }, "index": { "type": "integer" }, "relevance_score": { "type": "number" } } }, "schema.JINARerankRequest": { "type": "object", "properties": { "backend": { "type": "string" }, "documents": { "type": "array", "items": { "type": "string" } }, "model": { "type": "string" }, "query": { "type": "string" }, "top_n": { "type": "integer" } } }, "schema.JINARerankResponse": { "type": "object", "properties": { "model": { "type": "string" }, "results": { "type": "array", "items": { "$ref": "#/definitions/schema.JINADocumentResult" } }, "usage": { "$ref": "#/definitions/schema.JINAUsageInfo" } } }, "schema.JINAText": { "type": "object", "properties": { "text": { "type": "string" } } }, "schema.JINAUsageInfo": { "type": "object", "properties": { "prompt_tokens": { "type": "integer" }, "total_tokens": { "type": "integer" } } }, "schema.Job": { "type": "object", "properties": { "attachments": { "description": "Images, Videos, Audios and Files are the number of attachments the job\nwas started with; the content is not kept.", "type": "integer" }, "completed_at": { "type": "string" }, "created_at": { "type": "string" }, "error": { "description": "Error message if failed", "type": "string" }, "id": { "description": "UUID", "type": "string" }, "parameters": { "description": "Template parameters", "type": "object", "additionalProperties": { "type": "string" } }, "result": { "description": "Agent response", "type": "string" }, "started_at": { "type": "string" }, "status": { "description": "pending, running, completed, failed, cancelled", "allOf": [ { "$ref": "#/definitions/schema.JobStatus" } ] }, "task_id": { "description": "Reference to Task", "type": "string" }, "traces": { "description": "Execution traces (reasoning, tool calls, tool results)", "type": "array", "items": { "$ref": "#/definitions/schema.JobTrace" } }, "triggered_by": { "description": "\"manual\", \"cron\", \"api\"", "type": "string" }, "webhook_error": { "description": "Error if webhook failed", "type": "string" }, "webhook_sent": { "description": "Webhook delivery tracking", "type": "boolean" }, "webhook_sent_at": { "type": "string" } } }, "schema.JobExecutionRequest": { "type": "object", "properties": { "audios": { "type": "array", "items": { "type": "string" } }, "files": { "type": "array", "items": { "type": "string" } }, "images": { "description": "Attachments for the job, as data URIs (data:\u003cmime\u003e;base64,\u003cdata\u003e). An\naddress is not fetched: the server never makes a request on behalf of a\njob's caller. They are saved in the owner's files for the job to read.", "type": "array", "items": { "type": "string" } }, "parameters": { "description": "Optional, for templating", "type": "object", "additionalProperties": { "type": "string" } }, "task_id": { "description": "Required", "type": "string" }, "videos": { "type": "array", "items": { "type": "string" } } } }, "schema.JobExecutionResponse": { "type": "object", "properties": { "job_id": { "description": "unique job identifier", "type": "string" }, "status": { "description": "initial status (pending)", "type": "string" }, "url": { "description": "URL to poll for job status", "type": "string" } } }, "schema.JobStatus": { "type": "string", "enum": [ "pending", "running", "completed", "failed", "cancelled" ], "x-enum-varnames": [ "JobStatusPending", "JobStatusRunning", "JobStatusCompleted", "JobStatusFailed", "JobStatusCancelled" ] }, "schema.JobTrace": { "type": "object", "properties": { "arguments": { "description": "Tool arguments or result data", "type": "object", "additionalProperties": {} }, "content": { "description": "The actual trace content", "type": "string" }, "timestamp": { "description": "When this trace occurred", "type": "string" }, "tool_name": { "description": "Tool name (for tool_call/tool_result)", "type": "string" }, "type": { "description": "\"reasoning\", \"tool_call\", \"tool_result\", \"status\"", "type": "string" } } }, "schema.KnownBackend": { "type": "object", "properties": { "auto_detect": { "type": "boolean" }, "description": { "type": "string" }, "installed": { "description": "Installed is true when the backend is currently present on disk — i.e. it\nappears in gallery.ListSystemBackends(systemState). Importer-registered or\ncurated pref-only backends default to false unless they also show up on\ndisk. The import form uses this to warn users that submitting an import\nmay trigger an automatic backend download.", "type": "boolean" }, "modality": { "type": "string" }, "name": { "type": "string" } } }, "schema.LogprobContent": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "id": { "type": "integer" }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "$ref": "#/definitions/schema.LogprobContent" } } } }, "schema.Logprobs": { "type": "object", "properties": { "content": { "type": "array", "items": { "$ref": "#/definitions/schema.LogprobContent" } } } }, "schema.LogprobsValue": { "type": "object", "properties": { "enabled": { "description": "true if logprobs should be returned", "type": "boolean" } } }, "schema.Message": { "type": "object", "properties": { "content": { "description": "The message content" }, "function_call": { "description": "A result of a function call" }, "name": { "description": "The message name (used for tools calls)", "type": "string" }, "reasoning": { "description": "Reasoning content extracted from \u003cthinking\u003e...\u003c/thinking\u003e tags", "type": "string" }, "role": { "description": "The message role", "type": "string" }, "tool_call_id": { "type": "string" }, "tool_calls": { "type": "array", "items": { "$ref": "#/definitions/schema.ToolCall" } } } }, "schema.Model3DAnimationRequest": { "type": "object", "properties": { "inputs": { "type": "object", "additionalProperties": { "$ref": "#/definitions/schema.AnimationInput" } }, "model": { "type": "string" }, "params": { "type": "object", "additionalProperties": { "type": "string" } }, "response_format": { "type": "string" } } }, "schema.Model3DRequest": { "description": "3D asset generation request body. Generation is image-conditioned", "type": "object", "properties": { "background": { "description": "background handling: auto|keep|black|white", "type": "string" }, "cfg_scale": { "description": "classifier-free guidance scale (backend default 7.5)", "type": "number" }, "image": { "description": "conditioning image: URL, base64, or data URI (required)", "type": "string" }, "model": { "type": "string" }, "params": { "description": "backend-specific generation parameters", "type": "object", "additionalProperties": { "type": "string" } }, "quality": { "description": "mesh pipeline: auto|coarse|512|1024", "type": "string" }, "response_format": { "description": "output format (url or b64_json)", "type": "string" }, "seed": { "description": "random seed; \u003c=0 picks a random seed", "type": "integer" }, "step": { "description": "flow sampling steps (backend default 12)", "type": "integer" }, "texture_steps": { "description": "texture flow sampling steps (backend default 12)", "type": "integer" } } }, "schema.ModelCapabilities": { "type": "object", "properties": { "capabilities": { "description": "Capabilities are canonical usecase strings (e.g. chat, vision, transcript,\ntts, embeddings, image, video) plus the modifiers \"tools\" and \"thinking\".", "type": "array", "items": { "type": "string" } }, "context_size": { "description": "ContextSize is the effective context window in tokens the backend will\nrun with: the configured context_size, or the default when unset. 0 means\nthe value is unknown (e.g. a loose file with no config). Clients can use\nthis to size their context budget for auto-compaction and pruning.", "type": "integer" }, "id": { "type": "string" }, "input_modalities": { "description": "InputModalities is the subset of {text,image,audio,video} the model accepts.", "type": "array", "items": { "type": "string" } }, "object": { "type": "string" }, "output_modalities": { "description": "OutputModalities is the subset of {text,image,audio,video} the model produces.", "type": "array", "items": { "type": "string" } }, "three_d_operations": { "type": "array", "items": { "$ref": "#/definitions/schema.ThreeDOperation" } }, "upscale_scale": { "type": "integer" } } }, "schema.ModelCapabilitiesResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/schema.ModelCapabilities" } }, "object": { "type": "string" } } }, "schema.ModelLoadCancelRequest": { "type": "object", "properties": { "job_id": { "type": "string" } } }, "schema.ModelLoadCancelResponse": { "type": "object", "properties": { "current_job_id": { "type": "string" }, "job_id": { "type": "string" }, "model": { "type": "string" }, "retry_after": { "type": "integer" }, "state": { "type": "string" } } }, "schema.ModelLoadRequest": { "type": "object", "properties": { "model": { "type": "string" } } }, "schema.ModelLoadResponse": { "type": "object", "properties": { "loaded": { "description": "Loaded lists the model names actually resident in memory after the call.\nFor a pipeline model these are its sub-models, not the pipeline name.", "type": "array", "items": { "type": "string" } }, "message": { "description": "Message is a short human-readable status (\"model loaded\", or an error).", "type": "string" } } }, "schema.ModelLoadingStatus": { "type": "object", "properties": { "bytes_sent": { "type": "integer" }, "cancel_requested": { "description": "CancelRequested is true when an administrator cancelled the attempt.", "type": "boolean" }, "eta_seconds": { "description": "ETASeconds is omitted rather than guessed until enough bytes have moved\nfor the observed rate to mean anything. A confidently wrong ETA on a\ntwenty-minute wait is worse than none.", "type": "integer" }, "file_index": { "type": "integer" }, "job_id": { "description": "JobID names the load attempt. A cancel must quote it: it is the\nprecondition that keeps a cancel from hitting a replacement attempt.", "type": "string" }, "last_error": { "description": "LastError is the cause of a failed attempt.", "type": "string" }, "lease_expires_in": { "description": "LeaseExpiresIn is the seconds left on the owner's lease. It is negative\nwhen the lease already ran out, which means the owner is gone.", "type": "integer" }, "model": { "type": "string" }, "node": { "type": "string" }, "progress": { "type": "number" }, "retry_after": { "description": "RetryAfter is the seconds until a new load may start, for a failed attempt.", "type": "integer" }, "state": { "type": "string" }, "stop_deadline": { "type": "string" }, "stopping": { "description": "Stopping is true while the remote work of a failed attempt is not yet\nconfirmed ended. StopDeadline is when the model is released regardless.", "type": "boolean" }, "total_bytes": { "type": "integer" }, "total_files": { "type": "integer" } } }, "schema.ModelsDataResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/schema.OpenAIModel" } }, "object": { "type": "string" } } }, "schema.ModerationRequest": { "type": "object", "properties": { "input": { "type": "array", "items": { "type": "string" } }, "model": { "type": "string" } } }, "schema.ModerationResponse": { "type": "object", "properties": { "id": { "type": "string" }, "model": { "type": "string" }, "results": { "type": "array", "items": { "$ref": "#/definitions/schema.ModerationResult" } } } }, "schema.ModerationResult": { "type": "object", "properties": { "categories": { "type": "object", "additionalProperties": { "type": "boolean" } }, "category_applied_input_types": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } }, "category_scores": { "type": "object", "additionalProperties": { "type": "number", "format": "float64" } }, "flagged": { "type": "boolean" } } }, "schema.MultimediaSourceConfig": { "type": "object", "properties": { "headers": { "description": "Custom headers for HTTP request (e.g., Authorization)", "type": "object", "additionalProperties": { "type": "string" } }, "type": { "description": "\"image\", \"video\", \"audio\", \"file\"", "type": "string" }, "url": { "description": "URL to fetch from", "type": "string" } } }, "schema.NodeData": { "type": "object", "properties": { "id": { "type": "string" }, "lastSeen": { "type": "string" }, "name": { "type": "string" }, "serviceID": { "type": "string" }, "tunnelAddress": { "type": "string" } } }, "schema.ORAnnotation": { "type": "object", "properties": { "end_index": { "type": "integer" }, "start_index": { "type": "integer" }, "title": { "type": "string" }, "type": { "description": "url_citation", "type": "string" }, "url": { "type": "string" } } }, "schema.ORContentPart": { "type": "object", "properties": { "annotations": { "description": "REQUIRED for output_text - must always be present (use [])", "type": "array", "items": { "$ref": "#/definitions/schema.ORAnnotation" } }, "detail": { "description": "low|high|auto for images", "type": "string" }, "file_data": { "type": "string" }, "file_url": { "type": "string" }, "filename": { "type": "string" }, "image_url": { "type": "string" }, "logprobs": { "description": "REQUIRED for output_text - must always be present (use [])", "type": "array", "items": { "$ref": "#/definitions/schema.ORLogProb" } }, "refusal": { "type": "string" }, "text": { "description": "REQUIRED for output_text - must always be present (even if empty)", "type": "string" }, "type": { "description": "input_text|input_image|input_file|output_text|refusal", "type": "string" } } }, "schema.ORError": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" }, "param": { "type": "string" }, "type": { "description": "invalid_request|not_found|server_error|model_error|too_many_requests", "type": "string" } } }, "schema.ORFunctionTool": { "type": "object", "properties": { "description": { "type": "string" }, "name": { "type": "string" }, "parameters": { "type": "object", "additionalProperties": {} }, "strict": { "description": "Always include in response", "type": "boolean" }, "type": { "type": "string" } } }, "schema.ORIncompleteDetails": { "type": "object", "properties": { "reason": { "type": "string" } } }, "schema.ORInputTokensDetails": { "type": "object", "properties": { "cached_tokens": { "description": "Always include, even if 0", "type": "integer" } } }, "schema.ORItemField": { "type": "object", "properties": { "arguments": { "type": "string" }, "call_id": { "description": "Function call fields", "type": "string" }, "content": { "description": "string or []ORContentPart for messages" }, "encrypted_content": { "description": "Provider-specific encrypted content", "type": "string" }, "id": { "description": "Present for all output items", "type": "string" }, "name": { "type": "string" }, "output": { "description": "Function call output fields" }, "role": { "description": "Message fields", "type": "string" }, "status": { "description": "in_progress|completed|incomplete", "type": "string" }, "summary": { "description": "Reasoning fields (for type == \"reasoning\")", "type": "array", "items": { "$ref": "#/definitions/schema.ORContentPart" } }, "type": { "description": "message|function_call|function_call_output|reasoning|item_reference", "type": "string" } } }, "schema.ORLogProb": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" }, "top_logprobs": { "type": "array", "items": { "$ref": "#/definitions/schema.ORTopLogProb" } } } }, "schema.OROutputTokensDetails": { "type": "object", "properties": { "reasoning_tokens": { "description": "Always include, even if 0", "type": "integer" } } }, "schema.ORReasoning": { "type": "object", "properties": { "effort": { "type": "string" }, "summary": { "type": "string" } } }, "schema.ORReasoningParam": { "type": "object", "properties": { "effort": { "description": "\"none\"|\"low\"|\"medium\"|\"high\"|\"xhigh\"", "type": "string" }, "summary": { "description": "\"auto\"|\"concise\"|\"detailed\"", "type": "string" } } }, "schema.ORResponseResource": { "type": "object", "properties": { "background": { "type": "boolean" }, "completed_at": { "description": "Required: present as number or null", "type": "integer" }, "created_at": { "type": "integer" }, "error": { "description": "Always present, null if no error", "allOf": [ { "$ref": "#/definitions/schema.ORError" } ] }, "frequency_penalty": { "type": "number" }, "id": { "type": "string" }, "incomplete_details": { "description": "Always present, null if complete", "allOf": [ { "$ref": "#/definitions/schema.ORIncompleteDetails" } ] }, "instructions": { "type": "string" }, "max_output_tokens": { "type": "integer" }, "max_tool_calls": { "description": "nullable", "type": "integer" }, "metadata": { "description": "Metadata and operational flags", "type": "object", "additionalProperties": { "type": "string" } }, "model": { "type": "string" }, "object": { "description": "always \"response\"", "type": "string" }, "output": { "type": "array", "items": { "$ref": "#/definitions/schema.ORItemField" } }, "parallel_tool_calls": { "type": "boolean" }, "presence_penalty": { "type": "number" }, "previous_response_id": { "type": "string" }, "prompt_cache_key": { "description": "nullable", "type": "string" }, "reasoning": { "description": "nullable", "allOf": [ { "$ref": "#/definitions/schema.ORReasoning" } ] }, "safety_identifier": { "description": "Safety and caching", "type": "string" }, "service_tier": { "type": "string" }, "status": { "description": "in_progress|completed|failed|incomplete", "type": "string" }, "store": { "type": "boolean" }, "temperature": { "description": "Sampling parameters (always required)", "type": "number" }, "text": { "description": "Text format configuration", "allOf": [ { "$ref": "#/definitions/schema.ORTextConfig" } ] }, "tool_choice": {}, "tools": { "description": "Tool-related fields", "type": "array", "items": { "$ref": "#/definitions/schema.ORFunctionTool" } }, "top_logprobs": { "description": "Default to 0", "type": "integer" }, "top_p": { "type": "number" }, "truncation": { "description": "Truncation and reasoning", "type": "string" }, "usage": { "description": "Usage statistics", "allOf": [ { "$ref": "#/definitions/schema.ORUsage" } ] } } }, "schema.ORTextConfig": { "type": "object", "properties": { "format": { "$ref": "#/definitions/schema.ORTextFormat" } } }, "schema.ORTextFormat": { "type": "object", "properties": { "type": { "description": "\"text\" or \"json_schema\"", "type": "string" } } }, "schema.ORTopLogProb": { "type": "object", "properties": { "bytes": { "type": "array", "items": { "type": "integer" } }, "logprob": { "type": "number" }, "token": { "type": "string" } } }, "schema.ORUsage": { "type": "object", "properties": { "input_tokens": { "type": "integer" }, "input_tokens_details": { "description": "Always present", "allOf": [ { "$ref": "#/definitions/schema.ORInputTokensDetails" } ] }, "output_tokens": { "type": "integer" }, "output_tokens_details": { "description": "Always present", "allOf": [ { "$ref": "#/definitions/schema.OROutputTokensDetails" } ] }, "total_tokens": { "type": "integer" } } }, "schema.OpenAIModel": { "type": "object", "properties": { "id": { "type": "string" }, "object": { "type": "string" } } }, "schema.OpenAIRequest": { "type": "object", "required": [ "file" ], "properties": { "backend": { "type": "string" }, "batch": { "description": "Custom parameters - not present in the OpenAI API", "type": "integer" }, "clip_skip": { "description": "Diffusers", "type": "integer" }, "echo": { "type": "boolean" }, "encoding_format": { "description": "Embedding encoding format: \"float\" (default) or \"base64\" (OpenAI Node.js SDK default)", "type": "string" }, "file": { "description": "whisper", "type": "string" }, "files": { "description": "Multiple input images for img2img or inpainting", "type": "array", "items": { "type": "string" } }, "frequency_penalty": { "type": "number" }, "function_call": { "description": "might be a string or an object" }, "functions": { "description": "A list of available functions to call", "type": "array", "items": { "$ref": "#/definitions/functions.Function" } }, "grammar": { "description": "A grammar to constrain the LLM output", "type": "string" }, "grammar_json_functions": { "$ref": "#/definitions/functions.JSONFunctionStructure" }, "ignore_eos": { "type": "boolean" }, "include_sounds": { "type": "boolean" }, "include_speaker_profiles": { "type": "boolean" }, "include_text": { "type": "boolean" }, "input": {}, "instruction": { "description": "Edit endpoint", "type": "string" }, "language": { "description": "Also part of the OpenAI official spec", "type": "string" }, "logit_bias": { "description": "Map of token IDs to bias values (-100 to 100)", "type": "object", "additionalProperties": { "type": "number", "format": "float64" } }, "logprobs": { "description": "OpenAI API logprobs parameters\nlogprobs: boolean - if true, returns log probabilities of each output token\ntop_logprobs: integer 0-20 - number of most likely tokens to return at each token position", "allOf": [ { "$ref": "#/definitions/schema.LogprobsValue" } ] }, "max_completion_tokens": { "description": "MaxCompletionTokens is the modern alias for max_tokens\n(OpenAI deprecated max_tokens; gpt-5 / o-series reject it).\nAccepted on the wire so up-to-date clients can use the new\nname; the request middleware collapses it into Maxtokens so\ninternal code reads exactly one field.", "type": "integer" }, "max_tokens": { "type": "integer" }, "messages": { "description": "Messages is read only by chat/completion API calls", "type": "array", "items": { "$ref": "#/definitions/schema.Message" } }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "min_p": { "type": "number" }, "model": { "type": "string" }, "model_base_name": { "type": "string" }, "n": { "description": "Also part of the OpenAI official spec. use it for returning multiple results", "type": "integer" }, "n_keep": { "type": "integer" }, "negative_prompt": { "description": "NegativePrompt for image generation (matches Stable Diffusion WebUI /\nvLLM-Omni conventions). Combined, comma-separated, with any \"|\"-suffixed\nnegative tags in Prompt.", "type": "string" }, "negative_prompt_scale": { "type": "number" }, "pooling": { "description": "Pooling is a LocalAI extension for /v1/embeddings: how the backend's\nper-token vectors are reduced to a single embedding. \"\" or \"backend\"\nleaves pooling to the inference backend (the pre-existing behavior);\n\"mean\", \"last\" and \"decayed_mean\" pool Go-side from raw per-token\nvectors (the backend must run with the \"pooling:none\" option, which\nmodel configs get automatically when this is set).", "type": "string" }, "pooling_half_life_tokens": { "description": "PoolingHalfLifeTokens is a LocalAI extension for /v1/embeddings: the\nhalf-life (in tokens) of the \"decayed_mean\" pooling scheme — a token's\nweight halves every this-many positions counting back from the end of\nthe conversation. Defaults to 256 when unset.", "type": "integer" }, "presence_penalty": { "type": "number" }, "prompt": { "description": "Prompt is read only by completion/image API calls" }, "quality": { "description": "Image (not supported by OpenAI)", "type": "string" }, "reasoning_effort": { "type": "string" }, "ref_images": { "description": "Reference images for models that support them (e.g., Flux Kontext)", "type": "array", "items": { "type": "string" } }, "repeat_last_n": { "type": "integer" }, "repeat_penalty": { "type": "number" }, "response_format": { "description": "whisper/image" }, "rope_freq_base": { "type": "number" }, "rope_freq_scale": { "type": "number" }, "seed": { "type": "integer" }, "size": { "description": "image", "type": "string" }, "step": { "type": "integer" }, "stop": {}, "stream": { "type": "boolean" }, "stream_options": { "description": "StreamOptions opts into OpenAI streaming extensions, e.g. include_usage.", "allOf": [ { "$ref": "#/definitions/schema.StreamOptions" } ] }, "temperature": { "type": "number" }, "tfz": { "type": "number" }, "tokenizer": { "description": "RWKV (?)", "type": "string" }, "tool_choice": {}, "tools": { "type": "array", "items": { "$ref": "#/definitions/functions.Tool" } }, "top_k": { "type": "integer" }, "top_logprobs": { "description": "Number of top logprobs per token (0-20)", "type": "integer" }, "top_p": { "description": "Common options between all the API calls, part of the OpenAI spec", "type": "number" }, "translate": { "description": "Only for audio transcription", "type": "boolean" }, "typical_p": { "type": "number" } } }, "schema.OpenAIResponse": { "type": "object", "properties": { "choices": { "type": "array", "items": { "$ref": "#/definitions/schema.Choice" } }, "created": { "type": "integer" }, "data": { "type": "array", "items": { "$ref": "#/definitions/schema.Item" } }, "id": { "type": "string" }, "metadata": { "type": "object" }, "model": { "type": "string" }, "object": { "type": "string" }, "usage": { "description": "Usage is intentionally a pointer with omitempty: per the OpenAI\nchat-completion streaming spec, intermediate chunks must not carry\na ` + "`" + `usage` + "`" + ` field. Marshalling a value-typed usage would emit\n` + "`" + `\"usage\":{\"prompt_tokens\":0,...}` + "`" + ` on every chunk and break\nOpenAI-SDK consumers that filter on a truthy ` + "`" + `result.usage` + "`" + `\n(continuedev/continue, Kilo Code, Roo Code, etc.).", "allOf": [ { "$ref": "#/definitions/schema.OpenAIUsage" } ] } } }, "schema.OpenAIUsage": { "type": "object", "properties": { "completion_tokens": { "type": "integer" }, "compression_meta": { "$ref": "#/definitions/schema.CompressionMetadata" }, "input_tokens": { "description": "Fields for image generation API compatibility", "type": "integer" }, "input_tokens_details": { "$ref": "#/definitions/schema.InputTokensDetails" }, "output_tokens": { "type": "integer" }, "prompt_tokens": { "type": "integer" }, "timing_prompt_processing": { "description": "Extra timing data, disabled by default as is't not a part of OpenAI specification", "type": "number" }, "timing_token_generation": { "type": "number" }, "total_tokens": { "type": "integer" } } }, "schema.OpenResponsesRequest": { "type": "object", "properties": { "allowed_tools": { "description": "Restrict which tools can be invoked", "type": "array", "items": { "type": "string" } }, "background": { "description": "Run request in background", "type": "boolean" }, "frequency_penalty": { "description": "Frequency penalty (-2.0 to 2.0)", "type": "number" }, "include": { "description": "What to include in response", "type": "array", "items": { "type": "string" } }, "input": { "description": "string or []ORItemParam" }, "instructions": { "type": "string" }, "logit_bias": { "description": "OpenAI-compatible extensions (not in Open Responses spec)", "type": "object", "additionalProperties": { "type": "number", "format": "float64" } }, "max_output_tokens": { "type": "integer" }, "max_tool_calls": { "description": "Maximum number of tool calls", "type": "integer" }, "metadata": { "type": "object", "additionalProperties": { "type": "string" } }, "model": { "type": "string" }, "parallel_tool_calls": { "description": "Allow parallel tool calls", "type": "boolean" }, "presence_penalty": { "description": "Presence penalty (-2.0 to 2.0)", "type": "number" }, "previous_response_id": { "type": "string" }, "reasoning": { "$ref": "#/definitions/schema.ORReasoningParam" }, "service_tier": { "description": "\"auto\"|\"default\"|priority hint", "type": "string" }, "store": { "description": "Whether to store the response", "type": "boolean" }, "stream": { "type": "boolean" }, "temperature": { "type": "number" }, "text_format": { "description": "Additional parameters from spec" }, "tool_choice": { "description": "\"auto\"|\"required\"|\"none\"|{type:\"function\",name:\"...\"}" }, "tools": { "type": "array", "items": { "$ref": "#/definitions/schema.ORFunctionTool" } }, "top_logprobs": { "description": "Number of top logprobs to return", "type": "integer" }, "top_p": { "type": "number" }, "truncation": { "description": "\"auto\"|\"disabled\"", "type": "string" } } }, "schema.P2PNodesResponse": { "type": "object", "properties": { "federated_nodes": { "type": "array", "items": { "$ref": "#/definitions/schema.NodeData" } }, "llama_cpp_nodes": { "type": "array", "items": { "$ref": "#/definitions/schema.NodeData" } }, "mlx_nodes": { "type": "array", "items": { "$ref": "#/definitions/schema.NodeData" } } } }, "schema.PIIAnalyzeRequest": { "type": "object", "properties": { "detectors": { "description": "Detectors names the detector models to run (NER and/or pattern). Takes\nprecedence over Model.", "type": "array", "items": { "type": "string" } }, "model": { "description": "Model is a consuming model whose effective PII policy (own\npii.detectors, else the instance default detectors; PII must be\nenabled) is used when Detectors is empty.", "type": "string" }, "reveal": { "description": "Reveal includes the per-entity hash_prefix in the response. Honoured\nonly for admin callers; ignored otherwise. The raw matched value is\nnever returned regardless.", "type": "boolean" }, "text": { "description": "Text is the string to scan. Bounded only by the server's global HTTP\nbody limit.", "type": "string" } } }, "schema.PIIAnalyzeResponse": { "type": "object", "properties": { "blocked": { "type": "boolean" }, "correlation_id": { "type": "string" }, "entities": { "type": "array", "items": { "$ref": "#/definitions/schema.PIIEntity" } } } }, "schema.PIIEntity": { "type": "object", "properties": { "action": { "type": "string" }, "end": { "type": "integer" }, "entity_type": { "type": "string" }, "hash_prefix": { "type": "string" }, "score": { "type": "number" }, "source": { "type": "string" }, "start": { "type": "integer" } } }, "schema.PIIRedactResponse": { "type": "object", "properties": { "blocked": { "type": "boolean" }, "correlation_id": { "type": "string" }, "entities": { "type": "array", "items": { "$ref": "#/definitions/schema.PIIEntity" } }, "masked": { "type": "boolean" }, "redacted_text": { "type": "string" } } }, "schema.PagesChatRequest": { "type": "object", "properties": { "chat_id": { "description": "ChatID is a chat of the user. Empty means the page's own chat, which is\ncreated on first use.", "type": "string" }, "model": { "description": "Model is the model of a new page chat. Empty takes the model of the\nuser's most recent chat.", "type": "string" }, "text": { "type": "string" } } }, "schema.PagesChatResponse": { "type": "object", "properties": { "chat_id": { "type": "string" }, "pending_id": { "type": "string" }, "started": { "type": "boolean" }, "title": { "type": "string" } } }, "schema.PagesConsent": { "type": "object", "properties": { "allowed_at": { "description": "The version you allowed: when, and the size of its index.html and\npage.json and the lines of its index.html, to say what changed.", "type": "string" }, "lines": { "type": "integer" }, "meta_size": { "type": "integer" }, "size": { "type": "integer" }, "state": { "description": "State is none, allowed (this version) or changed (an earlier version).", "type": "string" } } }, "schema.PagesConsentRequest": { "type": "object", "properties": { "hash": { "type": "string" }, "once": { "type": "boolean" } } }, "schema.PagesConsentResponse": { "type": "object", "properties": { "expires": { "type": "string" }, "hash": { "type": "string" }, "kind": { "type": "string" }, "state": { "type": "string" }, "token": { "type": "string" } } }, "schema.PagesFile": { "type": "object", "properties": { "conflict_of": { "type": "string" }, "kind": { "description": "file or dir", "type": "string" }, "path": { "type": "string" }, "size": { "type": "integer" }, "version": { "type": "integer" } } }, "schema.PagesFileContent": { "type": "object", "properties": { "conflict_of": { "type": "string" }, "content": { "type": "string" }, "encoding": { "type": "string" }, "kind": { "description": "file or dir", "type": "string" }, "media_type": { "type": "string" }, "path": { "type": "string" }, "size": { "type": "integer" }, "version": { "type": "integer" } } }, "schema.PagesFileList": { "type": "object", "properties": { "entries": { "type": "array", "items": { "$ref": "#/definitions/schema.PagesFile" } } } }, "schema.PagesList": { "type": "object", "properties": { "pages": { "type": "array", "items": { "$ref": "#/definitions/schema.PagesPage" } } } }, "schema.PagesPage": { "type": "object", "properties": { "author": { "description": "Author is who wrote the current index.html: \"you\" or \"assistant\" for an\nown page, \"other\" for a shared page another account wrote. A shared page\nalso has AuthorID and AuthorName, the account that last wrote its\nindex.html.", "type": "string" }, "author_id": { "type": "string" }, "author_name": { "type": "string" }, "code_files": { "description": "A shared page has its shared folder (Folder, a workspace path, and\nFolderID, the id the shared-pages routes take), whether you may write in\nit, the hash of its code (index.html, page.json and the files of\ncode_files; a consent is kept against it) and your consent: none,\nallowed or changed. code_files are the scripts, style sheets and modules\nof the page's folder that the page names: the UI puts no other text\nfile into a shared page.", "type": "array", "items": { "type": "string" } }, "consent": { "type": "string" }, "description": { "type": "string" }, "folder": { "type": "string" }, "folder_id": { "type": "integer" }, "hash": { "type": "string" }, "icon": { "type": "string" }, "meta_size": { "type": "integer" }, "name": { "type": "string" }, "path": { "description": "inside the home: /pages/\u003cname\u003e", "type": "string" }, "rev": { "type": "integer" }, "size": { "type": "integer" }, "source": { "description": "Source is \"own\" for a page in the user's home and \"shared\" for a page of\na shared folder.", "type": "string" }, "title": { "type": "string" }, "updated_at": { "description": "UpdatedAt and UpdatedBy are the last change to anything in the folder.", "type": "string" }, "updated_by": { "type": "string" }, "widget": { "description": "Widget is the widget block of page.json: the page can be a tile on Home\n(a widget of type page in LocalAI/home.json). Absent when the page has\nnone.", "allOf": [ { "$ref": "#/definitions/schema.PagesWidget" } ] }, "writable": { "type": "boolean" } } }, "schema.PagesSharedList": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "pages": { "type": "array", "items": { "$ref": "#/definitions/schema.PagesPage" } } } }, "schema.PagesSharedSource": { "type": "object", "properties": { "consent": { "$ref": "#/definitions/schema.PagesConsent" }, "html": { "type": "string" }, "lines": { "type": "integer" }, "page": { "$ref": "#/definitions/schema.PagesPage" } } }, "schema.PagesSource": { "type": "object", "properties": { "html": { "type": "string" }, "page": { "$ref": "#/definitions/schema.PagesPage" } } }, "schema.PagesStarter": { "type": "object", "properties": { "description": { "type": "string" }, "icon": { "type": "string" }, "id": { "type": "string" }, "title": { "type": "string" } } }, "schema.PagesStarterList": { "type": "object", "properties": { "starters": { "type": "array", "items": { "$ref": "#/definitions/schema.PagesStarter" } } } }, "schema.PagesWidget": { "type": "object", "properties": { "size": { "description": "Size is the height of the tile: small, medium or large.", "type": "string" }, "title": { "description": "Title is the tile's title when it should differ from the page's.", "type": "string" } } }, "schema.PagesWriteRequest": { "type": "object", "properties": { "base": { "description": "Base is the version the page read. A file that changed since is kept and\nthe content goes to a conflict copy. Zero replaces the file.", "type": "integer" }, "content": { "type": "string" }, "path": { "type": "string" } } }, "schema.RouterCorpusAddRequest": { "type": "object", "properties": { "entries": { "type": "array", "items": { "$ref": "#/definitions/schema.RouterCorpusEntry" } } } }, "schema.RouterCorpusAddResponse": { "type": "object", "properties": { "added": { "description": "Added is how many entries were embedded, persisted, and indexed.", "type": "integer" }, "label_counts": { "description": "LabelCounts is the per-label exemplar count after the call.", "type": "object", "additionalProperties": { "type": "integer" } }, "router": { "type": "string" }, "skipped": { "description": "Skipped counts entries whose text was already in the corpus —\nduplicates are rejected rather than double-weighted.", "type": "integer" }, "total": { "description": "Total is the corpus size after the call.", "type": "integer" } } }, "schema.RouterCorpusClearResponse": { "type": "object", "properties": { "cleared": { "type": "integer" }, "router": { "type": "string" } } }, "schema.RouterCorpusEntry": { "type": "object", "properties": { "labels": { "type": "array", "items": { "type": "string" } }, "text": { "type": "string" } } }, "schema.RouterCorpusStatsResponse": { "type": "object", "properties": { "embedding_model": { "type": "string" }, "embedding_models": { "description": "EmbeddingModels lists the embedder fingerprints present in the\npersisted corpus; more than one means part of the corpus is\npending re-embedding on the next load.", "type": "array", "items": { "type": "string" } }, "label_counts": { "type": "object", "additionalProperties": { "type": "integer" } }, "router": { "type": "string" }, "store_name": { "type": "string" }, "total": { "type": "integer" } } }, "schema.RouterDecideNeighbor": { "type": "object", "properties": { "id": { "type": "string" }, "labels": { "type": "array", "items": { "type": "string" } }, "similarity": { "type": "number" } } }, "schema.RouterDecideRequest": { "type": "object", "properties": { "input": { "description": "Input is the user-visible prompt text to classify. Required.\nSchema-shape extraction (chat-message concatenation, etc.) is\nthe caller's responsibility — matches the Probe contract used\nby the in-band middleware.", "type": "string" }, "router": { "description": "Router is the name of the router model (a ModelConfig with a\n` + "`" + `router:` + "`" + ` block). Required.", "type": "string" } } }, "schema.RouterDecideResponse": { "type": "object", "properties": { "cache_similarity": { "description": "CacheSimilarity carries the cosine similarity of the cache hit\n(0 when not cached).", "type": "number" }, "cached": { "description": "Cached is true when the decision came from the L2 embedding\ncache rather than a fresh classifier run.", "type": "boolean" }, "candidate": { "description": "Candidate is the model that would be routed to. Empty when no\ncandidate covers Labels AND no fallback is configured.", "type": "string" }, "classifier": { "description": "Classifier is the classifier name that produced the decision\n(e.g. \"score\").", "type": "string" }, "fallback": { "description": "Fallback is true when Candidate is the router's configured\nfallback because no candidate covered Labels. Lets callers\ndistinguish \"matched\" from \"fell back\" without comparing names.", "type": "boolean" }, "labels": { "description": "Labels is the set of active policy labels.", "type": "array", "items": { "type": "string" } }, "latency_ms": { "description": "LatencyMs is the classifier's wall-clock cost.", "type": "integer" }, "nearest_similarity": { "description": "NearestSimilarity is the cosine similarity of the closest KNN\ncorpus entry — populated by the knn classifier even when the\ndecision fell back because the probe was out of corpus range.\n0 for other classifiers.", "type": "number" }, "neighbors": { "description": "Neighbors lists the corpus entries the knn classifier retrieved,\nby descending similarity, including ones below the similarity\ngate. Empty for other classifiers.", "type": "array", "items": { "$ref": "#/definitions/schema.RouterDecideNeighbor" } }, "router": { "description": "Router echoes the requested router model.", "type": "string" }, "score": { "description": "Score is the top label's softmax probability (the\nclassifier-side confidence signal).", "type": "number" } } }, "schema.SharedFolder": { "type": "object", "properties": { "id": { "description": "ID is the folder's stable ID. The shared pages use it as folder_id.", "type": "integer" }, "members": { "description": "Members is who may use the folder. Only in the administrator's view.", "type": "array", "items": { "$ref": "#/definitions/schema.SharedFolderMember" } }, "mode": { "description": "Mode is what you may do in the folder: read or write. Only in your\nown list.", "type": "string" }, "name": { "type": "string" }, "pages": { "description": "Pages is how many pages (pages/\u003cname\u003e/index.html) the folder has.", "type": "integer" }, "path": { "description": "Path is the folder's workspace path, /shared/\u003cname\u003e.", "type": "string" } } }, "schema.SharedFolderEvent": { "type": "object", "properties": { "action": { "description": "Action is create, rename, delete, restore, grant or revoke.", "type": "string" }, "actor": { "description": "Actor is the user who made the change, or \"@assistant\".", "type": "string" }, "actor_name": { "type": "string" }, "at": { "type": "string" }, "folder": { "type": "string" }, "folder_id": { "type": "integer" }, "mode": { "type": "string" }, "principal": { "type": "string" }, "rev": { "type": "integer" } } }, "schema.SharedFolderEventList": { "type": "object", "properties": { "events": { "type": "array", "items": { "$ref": "#/definitions/schema.SharedFolderEvent" } } } }, "schema.SharedFolderList": { "type": "object", "properties": { "folders": { "type": "array", "items": { "$ref": "#/definitions/schema.SharedFolder" } }, "max_folders": { "description": "MaxFolders and MaxMembers are the limits, in the administrator's view.", "type": "integer" }, "max_members": { "type": "integer" } } }, "schema.SharedFolderMember": { "type": "object", "properties": { "everyone": { "description": "Everyone is true for the member that stands for every user.", "type": "boolean" }, "mode": { "description": "Mode is read or write.", "type": "string" }, "name": { "description": "Name is the user's name; for \"@everyone\" it is \"@everyone\".", "type": "string" }, "principal": { "description": "Principal is the user ID, or \"@everyone\".", "type": "string" } } }, "schema.SharedFolderMemberRequest": { "type": "object", "properties": { "mode": { "type": "string" } } }, "schema.SharedFolderNameRequest": { "type": "object", "properties": { "name": { "type": "string" } } }, "schema.SharedFolderRemoved": { "type": "object", "properties": { "folder": { "$ref": "#/definitions/schema.SharedFolder" }, "undo_rev": { "description": "UndoRev is the change to undo with POST /api/chats/admin/shared-folders/restore.", "type": "integer" } } }, "schema.SharedFolderRestoreRequest": { "type": "object", "properties": { "rev": { "type": "integer" } } }, "schema.SlotCacheRequest": { "type": "object", "properties": { "id": { "description": "restore only: an ID issued by a save for this model", "type": "string" }, "model": { "type": "string" }, "slot": { "description": "slot id, 0 is the first slot", "type": "integer" } } }, "schema.SlotCacheResponse": { "type": "object", "properties": { "action": { "description": "\"save\" or \"restore\"", "type": "string" }, "duration_ms": { "description": "time the backend spent", "type": "number" }, "id": { "description": "issued by the save, sent back to restore", "type": "string" }, "message": { "description": "for example the IDs a save pruned", "type": "string" }, "model": { "type": "string" }, "n_bytes": { "description": "bytes written or read", "type": "integer" }, "n_tokens": { "description": "tokens saved or restored", "type": "integer" }, "slot": { "type": "integer" } } }, "schema.SoundClassification": { "type": "object", "properties": { "index": { "type": "integer" }, "label": { "type": "string" }, "score": { "type": "number" } } }, "schema.SoundClassificationResult": { "type": "object", "properties": { "detections": { "type": "array", "items": { "$ref": "#/definitions/schema.SoundClassification" } }, "model": { "type": "string" } } }, "schema.SpeakerEncoder": { "type": "object", "properties": { "dimension": { "type": "integer" }, "family": { "description": "Family is the embedding space of the encoder. The server fills it from the\nloaded encoder; exported profiles do not carry it and it is not matched.", "type": "string" }, "identity": { "type": "string" } } }, "schema.SpeakerProfile": { "type": "object", "properties": { "clean_duration": { "type": "number" }, "embedding": { "type": "array", "items": { "type": "number" } }, "intervals": { "type": "array", "items": { "$ref": "#/definitions/schema.SpeakerProfileInterval" } }, "speaker": { "type": "integer" }, "unavailable_reason": { "type": "string" } } }, "schema.SpeakerProfileInterval": { "type": "object", "properties": { "end": { "type": "number" }, "start": { "type": "number" } } }, "schema.SpeakerProfiles": { "type": "object", "properties": { "encoder": { "$ref": "#/definitions/schema.SpeakerEncoder" }, "speakers": { "type": "array", "items": { "$ref": "#/definitions/schema.SpeakerProfile" } }, "version": { "type": "integer" } } }, "schema.StreamOptions": { "type": "object", "properties": { "include_usage": { "type": "boolean" } } }, "schema.SysInfoModel": { "type": "object", "properties": { "backend": { "description": "Backend is the engine serving this model. The loader knows only the ID,\nso it is resolved from the model's config; empty when the model was\nloaded without one (a loose file, or a config since removed).", "type": "string" }, "id": { "type": "string" }, "process": { "description": "Process is the backend process serving the model on this host. Absent\nwhen the model has no local process (a distributed worker holds it) or\nthe process could not be read.", "allOf": [ { "$ref": "#/definitions/schema.SysInfoProcess" } ] }, "size_vram": { "description": "SizeVRAM is DRM-accounted resident device memory in bytes. Nil means\nthe backend process tree has no complete supported reading.", "type": "integer" } } }, "schema.SysInfoProcess": { "type": "object", "properties": { "cpu_percent": { "description": "CPUPercent is the share of the whole host's CPU used since the previous\nreading, 0-100. Absent on the first reading of a process.", "type": "number" }, "memory_percent": { "type": "number" }, "pid": { "type": "integer" }, "rss_bytes": { "description": "RSSBytes is resident host memory. Weights offloaded to a GPU are not\nin it.", "type": "integer" }, "started_at": { "type": "string" } } }, "schema.SystemInformationResponse": { "type": "object", "properties": { "backends": { "description": "available backend engines", "type": "array", "items": { "type": "string" } }, "loaded_models": { "description": "currently loaded models", "type": "array", "items": { "$ref": "#/definitions/schema.SysInfoModel" } } } }, "schema.SystemOneAnswer": { "type": "object", "properties": { "choice": { "type": "string" }, "confidence": { "type": "number" }, "entities": { "type": "array", "items": { "$ref": "#/definitions/schema.SystemOneEntity" } }, "legend": { "type": "object", "additionalProperties": { "type": "string" } }, "noul": { "type": "number" }, "probabilities": { "type": "object", "additionalProperties": { "type": "number", "format": "float64" } }, "score": { "type": "number" }, "type": { "type": "string" } } }, "schema.SystemOneEntity": { "type": "object", "properties": { "confidence": { "type": "number" }, "end": { "type": "integer" }, "start": { "type": "integer" }, "text": { "type": "string" } } }, "schema.SystemOnePermuteRequest": { "type": "object", "properties": { "n_perm": { "type": "integer" }, "question": { "type": "string" }, "request": { "$ref": "#/definitions/schema.SystemOneRequest" }, "seed": { "type": "integer" } } }, "schema.SystemOnePermuteResponse": { "type": "object", "properties": { "argmax_stable": { "type": "boolean" }, "runs": { "type": "array", "items": { "$ref": "#/definitions/schema.SystemOnePermuteRun" } }, "spread": { "type": "object", "additionalProperties": { "type": "number", "format": "float64" } } } }, "schema.SystemOnePermuteRun": { "type": "object", "properties": { "choice": { "type": "string" }, "latency_ms": { "type": "number" }, "order": { "type": "array", "items": { "type": "string" } }, "probabilities": { "type": "object", "additionalProperties": { "type": "number", "format": "float64" } } } }, "schema.SystemOneRequest": { "type": "object" }, "schema.SystemOneResponse": { "type": "object", "properties": { "answers": { "type": "object", "additionalProperties": { "$ref": "#/definitions/schema.SystemOneAnswer" } }, "latency_ms": { "type": "number" }, "model": { "type": "string" }, "usage": { "$ref": "#/definitions/schema.SystemOneUsage" } } }, "schema.SystemOneUsage": { "type": "object", "properties": { "input_tokens": { "type": "integer" }, "output_tokens": { "type": "integer" } } }, "schema.TTSRequest": { "description": "TTS request body", "type": "object", "properties": { "backend": { "description": "backend engine override", "type": "string" }, "input": { "description": "text input", "type": "string" }, "instructions": { "description": "Instructions is a free-form, per-request style/voice description. It maps to\nthe OpenAI ` + "`" + `instructions` + "`" + ` field and is forwarded to the backend so expressive\nTTS models (e.g. Qwen3-TTS CustomVoice/VoiceDesign) can vary tone or designed\nvoice per request instead of only via the static YAML option.", "type": "string" }, "language": { "description": "(optional) language to use with TTS model", "type": "string" }, "model": { "type": "string" }, "params": { "description": "Params carries optional, backend-specific per-request generation parameters\n(LocalAI extension, e.g. Chatterbox exaggeration/cfg_weight/temperature).", "type": "object", "additionalProperties": { "type": "string" } }, "response_format": { "description": "(optional) output format", "type": "string" }, "sample_rate": { "description": "(optional) desired output sample rate", "type": "integer" }, "speed": { "description": "Speed is the OpenAI ` + "`" + `speed` + "`" + ` field (0.25-4.0). It is a pointer so an\nexplicit ` + "`" + `\"speed\": 0` + "`" + ` (invalid, rejected with 400) is distinguishable\nfrom an omitted field (left at the backend default). It is normalised\ninto Params[\"speed\"] so it reaches the backend over the same channel as\nthe other per-request generation parameters.", "type": "number" }, "stream": { "description": "(optional) enable streaming TTS", "type": "boolean" }, "voice": { "description": "voice audio file or speaker id", "type": "string" } } }, "schema.Task": { "type": "object", "properties": { "agent_id": { "description": "AgentID is optional: a saved agent of the owner. The job gets only the\nagent's grants and instructions, as a chat with that agent would.", "type": "string" }, "created_at": { "type": "string" }, "cron": { "description": "Cron and CronParameters are refused: scheduling is done by the triggers of\nthe chats, which can run a saved agent on a schedule.", "type": "string" }, "cron_parameters": { "type": "object", "additionalProperties": { "type": "string" } }, "description": { "description": "Optional description", "type": "string" }, "enabled": { "description": "Can be disabled without deletion; absent means enabled", "type": "boolean" }, "id": { "description": "UUID", "type": "string" }, "model": { "description": "Model is the model the job talks to. It may be empty when agent_id names a\nsaved agent that has a model.", "type": "string" }, "multimedia_sources": { "description": "MultimediaSources is refused: it fed the cron jobs, which are triggers now.", "type": "array", "items": { "$ref": "#/definitions/schema.MultimediaSourceConfig" } }, "name": { "description": "User-friendly name", "type": "string" }, "prompt": { "description": "Template prompt (supports Go template .param syntax)", "type": "string" }, "updated_at": { "type": "string" }, "webhooks": { "description": "Webhook configuration (for notifications).\nSupports multiple webhook endpoints.\nWebhooks can handle both success and failure cases using template variables:\n.Job (Job object), .Task (Task object), .Result (if successful),\n.Error (if failed), .Status (job status string).", "type": "array", "items": { "$ref": "#/definitions/schema.WebhookConfig" } } } }, "schema.ThreeDInput": { "type": "object", "properties": { "label": { "type": "string" }, "max_bytes": { "type": "integer" }, "name": { "type": "string" }, "required": { "type": "boolean" }, "type": { "type": "string" } } }, "schema.ThreeDOperation": { "type": "object", "properties": { "endpoint": { "type": "string" }, "id": { "type": "string" }, "inputs": { "type": "array", "items": { "$ref": "#/definitions/schema.ThreeDInput" } }, "label": { "type": "string" }, "output": { "type": "string" }, "parameters": { "type": "array", "items": { "$ref": "#/definitions/schema.ThreeDParameter" } } } }, "schema.ThreeDParameter": { "type": "object", "properties": { "advanced": { "type": "boolean" }, "default": { "type": "string" }, "label": { "type": "string" }, "max": { "type": "number" }, "min": { "type": "number" }, "name": { "type": "string" }, "options": { "type": "array", "items": { "type": "string" } }, "type": { "type": "string" } } }, "schema.TokenizeRequest": { "type": "object", "properties": { "content": { "description": "text to tokenize", "type": "string" }, "model": { "type": "string" } } }, "schema.TokenizeResponse": { "type": "object", "properties": { "tokens": { "description": "token IDs", "type": "array", "items": { "type": "integer" } } } }, "schema.ToolCall": { "type": "object", "properties": { "function": { "$ref": "#/definitions/schema.FunctionCall" }, "id": { "type": "string" }, "index": { "type": "integer" }, "type": { "type": "string" } } }, "schema.VADRequest": { "description": "VAD request body", "type": "object", "properties": { "audio": { "description": "raw audio samples as float32 PCM", "type": "array", "items": { "type": "number" } }, "model": { "type": "string" } } }, "schema.VideoReference": { "type": "object", "properties": { "audio": { "description": "optional audio paired with this video", "type": "string" }, "fps": { "description": "frame rate of the source frames; 0 means the backend default", "type": "integer" }, "frames": { "description": "ordered frame images: URL, base64 or data URI", "type": "array", "items": { "type": "string" } } } }, "schema.VideoRequest": { "type": "object", "properties": { "audio": { "description": "URL or base64 audio for audio-conditioned generation", "type": "string" }, "cfg_scale": { "description": "classifier-free guidance scale", "type": "number" }, "end_image": { "description": "URL or base64 of the last frame", "type": "string" }, "fps": { "description": "frames per second", "type": "integer" }, "height": { "description": "output height in pixels", "type": "integer" }, "input_reference": { "description": "reference image or video URL", "type": "string" }, "model": { "type": "string" }, "negative_prompt": { "description": "things to avoid in the output", "type": "string" }, "num_frames": { "description": "total number of frames to generate", "type": "integer" }, "params": { "description": "backend-specific generation parameters", "type": "object", "additionalProperties": { "type": "string" } }, "prompt": { "description": "text description of the video to generate", "type": "string" }, "ref_audios": { "description": "reference audio clips (WAV); exclusive with start_image/end_image", "type": "array", "items": { "type": "string" } }, "ref_images": { "description": "reference images (URL, base64 or data URI); exclusive with start_image/end_image", "type": "array", "items": { "type": "string" } }, "ref_videos": { "description": "reference videos as frame lists; exclusive with start_image/end_image", "type": "array", "items": { "$ref": "#/definitions/schema.VideoReference" } }, "response_format": { "description": "output format (url or b64_json)", "type": "string" }, "seconds": { "description": "duration in seconds (alternative to num_frames)", "type": "string" }, "seed": { "description": "random seed for reproducibility", "type": "integer" }, "size": { "description": "WxH shorthand (e.g. \"512x512\")", "type": "string" }, "start_image": { "description": "URL or base64 of the first frame", "type": "string" }, "step": { "description": "number of diffusion steps", "type": "integer" }, "width": { "description": "output width in pixels", "type": "integer" } } }, "schema.VoiceAnalysis": { "type": "object", "properties": { "age": { "type": "number" }, "dominant_emotion": { "type": "string" }, "dominant_gender": { "type": "string" }, "emotion": { "type": "object", "additionalProperties": { "type": "number", "format": "float32" } }, "end": { "type": "number" }, "gender": { "type": "object", "additionalProperties": { "type": "number", "format": "float32" } }, "start": { "type": "number" } } }, "schema.VoiceAnalyzeRequest": { "type": "object", "properties": { "actions": { "description": "subset of {\"age\",\"gender\",\"emotion\"}", "type": "array", "items": { "type": "string" } }, "audio": { "type": "string" }, "model": { "type": "string" } } }, "schema.VoiceAnalyzeResponse": { "type": "object", "properties": { "segments": { "type": "array", "items": { "$ref": "#/definitions/schema.VoiceAnalysis" } } } }, "schema.VoiceEmbedRequest": { "type": "object", "properties": { "audio": { "type": "string" }, "model": { "type": "string" } } }, "schema.VoiceEmbedResponse": { "type": "object", "properties": { "dim": { "type": "integer" }, "embedding": { "type": "array", "items": { "type": "number" } }, "model": { "type": "string" } } }, "schema.VoiceForgetRequest": { "type": "object", "properties": { "id": { "type": "string" }, "model": { "type": "string" }, "store": { "type": "string" } } }, "schema.VoiceIdentifyMatch": { "type": "object", "properties": { "confidence": { "type": "number" }, "distance": { "type": "number" }, "id": { "type": "string" }, "labels": { "type": "object", "additionalProperties": { "type": "string" } }, "match": { "type": "boolean" }, "name": { "type": "string" } } }, "schema.VoiceIdentifyRequest": { "type": "object", "properties": { "audio": { "type": "string" }, "model": { "type": "string" }, "store": { "type": "string" }, "threshold": { "type": "number" }, "top_k": { "type": "integer" } } }, "schema.VoiceIdentifyResponse": { "type": "object", "properties": { "matches": { "type": "array", "items": { "$ref": "#/definitions/schema.VoiceIdentifyMatch" } } } }, "schema.VoiceRegisterRequest": { "type": "object", "properties": { "audio": { "type": "string" }, "labels": { "type": "object", "additionalProperties": { "type": "string" } }, "model": { "type": "string" }, "name": { "type": "string" }, "speaker_profiles": { "$ref": "#/definitions/schema.SpeakerProfiles" }, "speaker_slot": { "type": "integer" }, "store": { "type": "string" } } }, "schema.VoiceRegisterResponse": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "registered_at": { "type": "string" } } }, "schema.VoiceVerifyRequest": { "type": "object", "properties": { "anti_spoofing": { "type": "boolean" }, "audio1": { "type": "string" }, "audio2": { "type": "string" }, "model": { "type": "string" }, "threshold": { "type": "number" } } }, "schema.VoiceVerifyResponse": { "type": "object", "properties": { "confidence": { "type": "number" }, "distance": { "type": "number" }, "model": { "type": "string" }, "processing_time_ms": { "type": "number" }, "threshold": { "type": "number" }, "verified": { "type": "boolean" } } }, "schema.WebhookConfig": { "type": "object", "properties": { "headers": { "description": "Custom headers (e.g., Authorization)", "type": "object", "additionalProperties": { "type": "string" } }, "method": { "description": "HTTP method (POST, PUT, PATCH) - default: POST", "type": "string" }, "payload_template": { "description": "Optional template for payload", "type": "string" }, "url": { "description": "Webhook endpoint URL", "type": "string" } } }, "schema.WorkspaceChange": { "type": "object", "properties": { "kinds": { "description": "Kinds are the kinds of the change sets: user, agent, upload or undo.", "type": "array", "items": { "type": "string" } }, "paths": { "type": "array", "items": { "type": "string" } }, "revision": { "description": "Revision is the newest revision of the changes; it is also the event id,\nwhich a client sends back (Last-Event-ID or ?after=) to resume.", "type": "integer" } } }, "updates.State": { "type": "string", "enum": [ "unknown", "up-to-date", "update-available", "incompatible", "check-failed", "integrity-error" ], "x-enum-varnames": [ "Unknown", "UpToDate", "UpdateAvailable", "Incompatible", "CheckFailed", "IntegrityError" ] }, "updates.Status": { "type": "object", "properties": { "addonId": { "type": "string", "example": "notes" }, "available": { "description": "Available is true only for update-available.", "type": "boolean" }, "candidateDigest": { "type": "string" }, "candidateVersion": { "type": "string", "example": "1.1.0" }, "channel": { "type": "string", "example": "development" }, "checkedAt": { "description": "CheckedAt is when the status was computed. LastSuccess is when the\nlibrary was last read successfully: a failed check keeps it, so the\npage can say how old the knowledge is.", "type": "string" }, "error": { "description": "Error is the redacted class of a failed check.", "type": "string", "example": "refresh-failed" }, "generation": { "description": "Generation is the installed generation the status describes.", "type": "integer", "example": 1 }, "installedDigest": { "type": "string" }, "installedVersion": { "type": "string", "example": "1.0.0" }, "lastSuccess": { "type": "string" }, "reasons": { "description": "Reasons are the compatibility reasons of an incompatible or\nintegrity-error status.", "type": "array", "items": { "type": "string" } }, "selection": { "type": "string", "example": "1.0.0" }, "sourceId": { "description": "SourceID, Channel and Selection are the library, channel and\nselection the add-on was installed from. They never change by themselves.", "type": "string", "example": "official" }, "stale": { "description": "Stale is true when the library data or the cached answer is older than\nthe time to live.", "type": "boolean" }, "state": { "enum": [ "unknown", "up-to-date", "update-available", "incompatible", "check-failed", "integrity-error" ], "allOf": [ { "$ref": "#/definitions/updates.State" } ], "example": "update-available" }, "throttled": { "description": "Throttled is true when an explicit refresh was not performed because\none ran moments ago. The status is then the last one.", "type": "boolean" } } }, "voiceprofile.AudioMetadata": { "type": "object", "properties": { "bit_depth": { "type": "integer" }, "channels": { "type": "integer" }, "duration_ms": { "type": "integer" }, "mime_type": { "type": "string" }, "sample_rate": { "type": "integer" }, "size_bytes": { "type": "integer" } } }, "voiceprofile.Profile": { "type": "object", "properties": { "audio": { "$ref": "#/definitions/voiceprofile.AudioMetadata" }, "consent_confirmed_at": { "type": "string" }, "created_at": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "string" }, "language": { "type": "string" }, "name": { "type": "string" }, "references": { "type": "array", "items": { "$ref": "#/definitions/voiceprofile.ReferenceMetadata" } }, "transcript": { "type": "string" }, "updated_at": { "type": "string" }, "voice": { "type": "string" } } }, "voiceprofile.ReferenceMetadata": { "type": "object", "properties": { "audio": { "$ref": "#/definitions/voiceprofile.AudioMetadata" }, "transcript": { "type": "string" } } } }, "securityDefinitions": { "BearerAuth": { "type": "apiKey", "name": "Authorization", "in": "header" } } }` // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ Version: "2.0.0", Host: "", BasePath: "/", Schemes: []string{"http", "https"}, Title: "LocalAI API", Description: "The LocalAI Rest API.", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, LeftDelim: "{{", RightDelim: "}}", } func init() { swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) }