478 lines
15 KiB
JSON
478 lines
15 KiB
JSON
{
|
|
"/api/v1/chat/completions": {
|
|
"post": {
|
|
"summary": "Account-limited online app conversation",
|
|
"description": "Requires a Mesh bearer token and X-Mesh-User. The node keeps the provider key private, bounds context and output, and enforces persistent daily account and node limits. Each model request, including tool continuations and failed provider attempts, uses one allowance unit. Tools execute only in the client harness. A disabled or unavailable provider returns 503; exhausted allowances return 429.",
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": [
|
|
"messages"
|
|
],
|
|
"properties": {
|
|
"messages": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"maxItems": 20,
|
|
"items": {
|
|
"type": "object"
|
|
}
|
|
},
|
|
"context": {
|
|
"type": "object"
|
|
},
|
|
"tools": {
|
|
"type": "array",
|
|
"maxItems": 64,
|
|
"items": {
|
|
"type": "object"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Assistant message or tool calls, and remaining allowance"
|
|
},
|
|
"400": {
|
|
"description": "Malformed or oversized context"
|
|
},
|
|
"401": {
|
|
"description": "Account authentication required"
|
|
},
|
|
"429": {
|
|
"description": "Daily allowance exhausted"
|
|
},
|
|
"503": {
|
|
"description": "Online chat unavailable"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/feedback": {
|
|
"post": {
|
|
"summary": "Deliver an account's app feedback",
|
|
"description": "Idempotent by account and 64-character report ID. Up to 20 reports per account per UTC day. Feedback contains only the authored report and bounded app diagnostics, and is private to its account and node operator.",
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"app_id",
|
|
"title",
|
|
"message"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"minLength": 64,
|
|
"maxLength": 64
|
|
},
|
|
"app_id": {
|
|
"const": "inbe"
|
|
},
|
|
"title": {
|
|
"type": "string",
|
|
"maxLength": 160
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"maxLength": 4096
|
|
},
|
|
"context": {
|
|
"type": "string",
|
|
"maxLength": 2048
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Saved report ID"
|
|
},
|
|
"400": {
|
|
"description": "Invalid feedback"
|
|
},
|
|
"401": {
|
|
"description": "Account authentication required"
|
|
},
|
|
"429": {
|
|
"description": "Daily report allowance exhausted"
|
|
},
|
|
"503": {
|
|
"description": "Feedback service unavailable"
|
|
}
|
|
}
|
|
},
|
|
"get": {
|
|
"summary": "Read the account's reports and developer replies",
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Up to 100 reports with replies"
|
|
},
|
|
"401": {
|
|
"description": "Account authentication required"
|
|
},
|
|
"503": {
|
|
"description": "Feedback service unavailable"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/admin/feedback": {
|
|
"get": {
|
|
"summary": "Private developer feedback inbox",
|
|
"description": "Requires X-Mesh-Admin with the feedback token or the existing admin token. Disabled when neither is configured.",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Up to 100 newest reports"
|
|
},
|
|
"401": {
|
|
"description": "Operator authentication required"
|
|
},
|
|
"403": {
|
|
"description": "Remote operator access disabled"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/admin/feedback/reply": {
|
|
"post": {
|
|
"summary": "Reply to an app feedback report",
|
|
"description": "Requires X-Mesh-Admin and the account_id returned by the private inbox. Replies target exactly one account's report. Without reply_id, the reply is the report's single reply and replaces an earlier one. With a 64-character hexadecimal reply_id, it is added beside the report's earlier replies; retrying the same reply_id and reply changes nothing, and reusing a reply_id for another reply returns 409. The reporting account can read replies through GET /api/v1/feedback. Use replies=1 and a numeric offset to retrieve at most two replies per page, oldest first and without report diagnostics; each reply carries its own id (the report's ID for the single reply) and its report's title.",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": [
|
|
"account_id",
|
|
"id",
|
|
"reply"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"minLength": 64,
|
|
"maxLength": 64
|
|
},
|
|
"reply": {
|
|
"type": "string",
|
|
"maxLength": 4096
|
|
},
|
|
"account_id": {
|
|
"type": "string",
|
|
"minLength": 64,
|
|
"maxLength": 64
|
|
},
|
|
"reply_id": {
|
|
"type": "string",
|
|
"pattern": "^[0-9a-f]{64}$"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Report replied to"
|
|
},
|
|
"400": {
|
|
"description": "Invalid reply"
|
|
},
|
|
"401": {
|
|
"description": "Operator authentication required"
|
|
},
|
|
"404": {
|
|
"description": "Report not found"
|
|
},
|
|
"409": {
|
|
"description": "Reply ID already used for another reply"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/chat/spelling": {
|
|
"post": {
|
|
"summary": "Account-limited spelling correction",
|
|
"description": "Requires a Mesh bearer token and X-Mesh-User. Corrects only misspelled words in one text of up to 8192 bytes and returns the whole text with its surrounding blank space unchanged. The text is not stored. Each request uses one unit of the same daily account and node allowance as online chat. A disabled or unavailable provider returns 503; exhausted allowances return 429.",
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": [
|
|
"text"
|
|
],
|
|
"properties": {
|
|
"text": {
|
|
"type": "string",
|
|
"maxLength": 8192
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Corrected text and remaining allowance"
|
|
},
|
|
"400": {
|
|
"description": "Empty or oversized text"
|
|
},
|
|
"401": {
|
|
"description": "Account authentication required"
|
|
},
|
|
"429": {
|
|
"description": "Daily allowance exhausted"
|
|
},
|
|
"503": {
|
|
"description": "Online chat unavailable"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/chat/habit-icons": {
|
|
"post": {
|
|
"summary": "Account-limited habit icon choice",
|
|
"description": "Requires a Mesh bearer token and X-Mesh-User. Chooses, for each habit in order, one of the offered icon names that obviously fits it, or an empty string when none clearly fits. Offer 1 to 64 distinct icon names of 1 to 32 lowercase letters, digits or underscores, and 1 to 32 habits with a non-blank name of up to 64 bytes and an optional description of up to 256 bytes. Habits and answers are not stored. Each request uses one unit of the same daily account and node allowance as online chat. A disabled or unavailable provider or an unusable model answer returns 503; exhausted allowances return 429.",
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": [
|
|
"icons",
|
|
"habits"
|
|
],
|
|
"properties": {
|
|
"icons": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"maxItems": 64,
|
|
"uniqueItems": true,
|
|
"items": {
|
|
"type": "string",
|
|
"pattern": "^[a-z0-9_]{1,32}$"
|
|
}
|
|
},
|
|
"habits": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"maxItems": 32,
|
|
"items": {
|
|
"type": "object",
|
|
"required": [
|
|
"name"
|
|
],
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"maxLength": 64
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"maxLength": 256
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "One icon name or empty string per habit, in order, and remaining allowance"
|
|
},
|
|
"400": {
|
|
"description": "Invalid icon names or habits"
|
|
},
|
|
"401": {
|
|
"description": "Account authentication required"
|
|
},
|
|
"429": {
|
|
"description": "Daily allowance exhausted"
|
|
},
|
|
"503": {
|
|
"description": "Online chat unavailable or invalid model response"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/lumi/developer": {
|
|
"post": {
|
|
"summary": "Submit or read a turn in the owner's developer chat",
|
|
"description": "Requires a signed Mesh account session for the configured Lumi owner. Supply text to submit a turn. Omit text to read its result. Repeating the same ID and text retrieves the existing turn for seven days.",
|
|
"security": [
|
|
{
|
|
"bearerAuth": []
|
|
}
|
|
],
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": [
|
|
"id"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"pattern": "^[0-9a-f]{32}$"
|
|
},
|
|
"text": {
|
|
"type": "string",
|
|
"description": "Prompt, up to 8192 UTF-8 bytes"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "The turn ID and its reply once available"
|
|
},
|
|
"400": {
|
|
"description": "Invalid turn"
|
|
},
|
|
"401": {
|
|
"description": "Account authentication required"
|
|
},
|
|
"403": {
|
|
"description": "Owner account required"
|
|
},
|
|
"404": {
|
|
"description": "Unknown turn"
|
|
},
|
|
"409": {
|
|
"description": "Turn ID is already used for different text"
|
|
},
|
|
"429": {
|
|
"description": "Developer queue is full"
|
|
},
|
|
"503": {
|
|
"description": "Developer chat unavailable"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api/v1/admin/lumi/developer": {
|
|
"get": {
|
|
"summary": "Read the next developer turn for Harmony",
|
|
"description": "Requires a direct loopback request with the dedicated developer token in X-Mesh-Admin.",
|
|
"responses": {
|
|
"200": {
|
|
"description": "The owner account and the next pending turn, if present"
|
|
},
|
|
"401": {
|
|
"description": "Developer relay authentication required"
|
|
},
|
|
"403": {
|
|
"description": "Direct loopback required"
|
|
},
|
|
"503": {
|
|
"description": "Developer chat unavailable"
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"summary": "Save Harmony's result for a developer turn",
|
|
"description": "Requires a direct loopback request with the dedicated developer token in X-Mesh-Admin. Submit the account_id and id from the inbox with the reply. Repeating the same reply leaves the terminal turn unchanged.",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": [
|
|
"account_id",
|
|
"id",
|
|
"reply"
|
|
],
|
|
"properties": {
|
|
"account_id": {
|
|
"type": "string",
|
|
"pattern": "^[0-9a-f]{64}$"
|
|
},
|
|
"id": {
|
|
"type": "string",
|
|
"pattern": "^[0-9a-f]{32}$"
|
|
},
|
|
"reply": {
|
|
"type": "string",
|
|
"description": "Result, up to 8192 UTF-8 bytes"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Reply stored"
|
|
},
|
|
"400": {
|
|
"description": "Invalid reply"
|
|
},
|
|
"401": {
|
|
"description": "Developer relay authentication required"
|
|
},
|
|
"403": {
|
|
"description": "Direct loopback required"
|
|
},
|
|
"409": {
|
|
"description": "Turn is unavailable or already has a different reply"
|
|
},
|
|
"503": {
|
|
"description": "Developer chat unavailable"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |