{
  "openapi": "3.1.0",
  "info": {
    "title": "llmgw client API",
    "version": "v1",
    "description": "OpenAI's API, as llmgw serves it, and what llmgw adds: pictures and 3D models from ComfyUI, knowledge bases, memory notes, stored conversations.\n\nThe SDKs of OpenAI and Anthropic work against it unchanged: set the base URL to the gateway's /v1 and the key to an llmgw key. A request carries more than is listed here: what the gateway does not read goes to the engine as it came. Headers llmgw reads: x-llmgw-thread (continue a stored conversation), x-llmgw-knowledge (answer from these collections), x-llmgw-tags (tags kept with the usage), x-session-id (stay on one replica). Headers it sends back: x-request-id, x-llmgw-served-model, x-llmgw-hardware, x-llmgw-seed, and Retry-After when waiting helps.\n\nGenerated from the route table in internal/clientapi; see docs/clients.md."
  },
  "servers": [
    {
      "url": "http://localhost:8080",
      "description": "A gateway at its default address, listen."
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "3d"
    },
    {
      "name": "audio"
    },
    {
      "name": "batches"
    },
    {
      "name": "chat"
    },
    {
      "name": "completions"
    },
    {
      "name": "embeddings"
    },
    {
      "name": "files"
    },
    {
      "name": "images"
    },
    {
      "name": "kb"
    },
    {
      "name": "mcp"
    },
    {
      "name": "me"
    },
    {
      "name": "memory"
    },
    {
      "name": "messages"
    },
    {
      "name": "models"
    },
    {
      "name": "moderations"
    },
    {
      "name": "rerank"
    },
    {
      "name": "responses"
    },
    {
      "name": "score"
    },
    {
      "name": "threads"
    },
    {
      "name": "workflows"
    }
  ],
  "paths": {
    "/mcp": {
      "post": {
        "operationId": "postMcp",
        "summary": "The gateway's MCP server: the memory notes, and pictures, 3D models, vision and workflows, as tools",
        "tags": [
          "mcp"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MCPRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Any JSON value."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/me": {
      "get": {
        "operationId": "getMe",
        "summary": "The caller: its key, its place in the tree, its limits and what it has used",
        "tags": [
          "me"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/3d/generations": {
      "post": {
        "operationId": "post3dGenerations",
        "summary": "A 3D model from a picture, as a job",
        "description": "Answered 202 with the job; ask after it until it is completed, then download output_file_id from /v1/files.",
        "tags": [
          "3d"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MeshRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: started, and running on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "get": {
        "operationId": "get3dGenerations",
        "summary": "The caller's 3D jobs, newest first",
        "tags": [
          "3d"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "The most jobs to answer with, at most 100; 20 when absent.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "A job's ID: those asked for before it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/3d/generations/{id}": {
      "get": {
        "operationId": "get3dGenerationsId",
        "summary": "A 3D job: its status, progress and result",
        "tags": [
          "3d"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The job's ID, job_….",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/3d/generations/{id}/cancel": {
      "post": {
        "operationId": "post3dGenerationsIdCancel",
        "summary": "Stop a 3D job, in the engine's queue too",
        "tags": [
          "3d"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The job's ID, job_….",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/audio/transcriptions": {
      "post": {
        "operationId": "postAudioTranscriptions",
        "summary": "Speech to text",
        "tags": [
          "audio"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/TranscriptionForm"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Transcription"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/audio/translations": {
      "post": {
        "operationId": "postAudioTranslations",
        "summary": "Speech to English text",
        "tags": [
          "audio"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/TranscriptionForm"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Transcription"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/batches": {
      "post": {
        "operationId": "postBatches",
        "summary": "Run a file of requests at the lowest priority",
        "tags": [
          "batches"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Batch"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "get": {
        "operationId": "getBatches",
        "summary": "The caller's batches",
        "tags": [
          "batches"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "The most batches to answer with; 20 when absent.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "A batch's ID: those made before it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/batches/{id}": {
      "get": {
        "operationId": "getBatchesId",
        "summary": "A batch and how far it is",
        "tags": [
          "batches"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The batch's ID, batch_….",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Batch"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/batches/{id}/cancel": {
      "post": {
        "operationId": "postBatchesIdCancel",
        "summary": "Stop a batch",
        "tags": [
          "batches"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The batch's ID, batch_….",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Batch"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/chat/completions": {
      "post": {
        "operationId": "postChatCompletions",
        "summary": "A chat turn",
        "description": "A model's name, an alias, or an adapter's name. Fields not listed go to the engine as sent. With a knowledge base, x-llmgw-knowledge names the collections to answer from; x-llmgw-thread continues a stored conversation.",
        "tags": [
          "chat"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatCompletionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatCompletion"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "With stream: true, server-sent events: one JSON chunk per data: line, then data: [DONE]."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/completions": {
      "post": {
        "operationId": "postCompletions",
        "summary": "A prompt continued",
        "tags": [
          "completions"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompletionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Completion"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "With stream: true, server-sent events: one JSON chunk per data: line, then data: [DONE]."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/embeddings": {
      "post": {
        "operationId": "postEmbeddings",
        "summary": "Vectors for texts",
        "tags": [
          "embeddings"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmbeddingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbeddingList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/files": {
      "post": {
        "operationId": "postFiles",
        "summary": "Upload a file: a batch's input",
        "tags": [
          "files"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/FileForm"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/File"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "get": {
        "operationId": "getFiles",
        "summary": "The caller's files",
        "tags": [
          "files"
        ],
        "parameters": [
          {
            "name": "purpose",
            "in": "query",
            "description": "Only files of this purpose: batch, batch_output, job_output.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/files/{id}": {
      "get": {
        "operationId": "getFilesId",
        "summary": "A file",
        "tags": [
          "files"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The file's ID, file-….",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/File"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteFilesId",
        "summary": "Delete a file",
        "tags": [
          "files"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The file's ID, file-….",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deleted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/files/{id}/content": {
      "get": {
        "operationId": "getFilesIdContent",
        "summary": "A file's content",
        "tags": [
          "files"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The file's ID, file-….",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/images/generations": {
      "post": {
        "operationId": "postImagesGenerations",
        "summary": "Pictures, of a model that makes them",
        "description": "Made by ComfyUI. Pictures come back as b64_json and are kept nowhere; x-llmgw-seed says the seed.",
        "tags": [
          "images"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImagesResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/kb/collections": {
      "get": {
        "operationId": "getKbCollections",
        "summary": "The knowledge-base collections the caller may read",
        "tags": [
          "kb"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/router.KBCollectionView"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/kb/collections/{id}/documents": {
      "put": {
        "operationId": "putKbCollectionsIdDocuments",
        "summary": "Add or replace a document, read and embedded by the client",
        "tags": [
          "kb"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The collection's ID, its name when that is unique, or ORG/NAME.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/router.KBPutDocument"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/router.KBPutResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteKbCollectionsIdDocuments",
        "summary": "Take a document out of a collection",
        "tags": [
          "kb"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The collection's ID, its name when that is unique, or ORG/NAME.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "required": true,
            "description": "The document's name, as the manifest lists it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KBDeleted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/kb/collections/{id}/manifest": {
      "get": {
        "operationId": "getKbCollectionsIdManifest",
        "summary": "A collection and its documents",
        "tags": [
          "kb"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The collection's ID, its name when that is unique, or ORG/NAME.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/router.KBManifest"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/memory": {
      "get": {
        "operationId": "getMemory",
        "summary": "The project's notes",
        "tags": [
          "memory"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemoryList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/memory/{key}": {
      "put": {
        "operationId": "putMemoryKey",
        "summary": "Keep a note for the project",
        "tags": [
          "memory"
        ],
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "description": "The note's key, chosen by the caller.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemoryWrite"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemoryNote"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "get": {
        "operationId": "getMemoryKey",
        "summary": "A note",
        "tags": [
          "memory"
        ],
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "description": "The note's key, chosen by the caller.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemoryNote"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteMemoryKey",
        "summary": "Forget a note",
        "tags": [
          "memory"
        ],
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "description": "The note's key, chosen by the caller.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/messages": {
      "post": {
        "operationId": "postMessages",
        "summary": "Anthropic's Messages API, for Claude Code and Anthropic's SDKs",
        "description": "The key is sent as x-api-key or as a bearer token.",
        "tags": [
          "messages"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessagesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Any JSON value."
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "With stream: true, server-sent events: one JSON chunk per data: line, then data: [DONE]."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/messages/count_tokens": {
      "post": {
        "operationId": "postMessagesCountTokens",
        "summary": "How many tokens a Messages request would be",
        "tags": [
          "messages"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessagesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenCount"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/models": {
      "get": {
        "operationId": "getModels",
        "summary": "The models the key may use",
        "tags": [
          "models"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/moderations": {
      "post": {
        "operationId": "postModerations",
        "summary": "Texts judged by the guardrails' judge model",
        "tags": [
          "moderations"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModerationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModerationResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/rerank": {
      "post": {
        "operationId": "postRerank",
        "summary": "Documents ordered by a query, for a reranker vLLM serves",
        "tags": [
          "rerank"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RerankRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Any JSON value."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/responses": {
      "post": {
        "operationId": "postResponses",
        "summary": "OpenAI's Responses API, for Codex and the like",
        "tags": [
          "responses"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResponsesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Any JSON value."
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "With stream: true, server-sent events: one JSON chunk per data: line, then data: [DONE]."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/score": {
      "post": {
        "operationId": "postScore",
        "summary": "Pairs of texts scored, for a scorer vLLM serves",
        "tags": [
          "score"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScoreRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Any JSON value."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/threads/{id}": {
      "delete": {
        "operationId": "deleteThreadsId",
        "summary": "Forget a stored conversation",
        "tags": [
          "threads"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The conversation's ID, as sent in x-llmgw-thread.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/workflows/runs": {
      "post": {
        "operationId": "postWorkflowsRuns",
        "summary": "Run a ComfyUI model's workflow, as a job",
        "description": "Inputs are those the model's workflow lists in /v1/models. Answered 202 with the job; download output_file_id from /v1/files once it is completed.",
        "tags": [
          "workflows"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted: started, and running on.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "get": {
        "operationId": "getWorkflowsRuns",
        "summary": "The caller's jobs, newest first",
        "tags": [
          "workflows"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "The most jobs to answer with, at most 100; 20 when absent.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "A job's ID: those asked for before it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/workflows/runs/{id}": {
      "get": {
        "operationId": "getWorkflowsRunsId",
        "summary": "A run: its status, progress and result",
        "tags": [
          "workflows"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The job's ID, job_….",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/workflows/runs/{id}/cancel": {
      "post": {
        "operationId": "postWorkflowsRunsIdCancel",
        "summary": "Stop a run, in the engine's queue too",
        "tags": [
          "workflows"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The job's ID, job_….",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key, sk-llmgw-…, made with `llmgw keys create` or on the portal's profile page. Sent as Authorization: Bearer KEY; /v1/messages also takes it as x-api-key."
      }
    },
    "responses": {
      "Error": {
        "description": "Refused: the error says why.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "The token is missing or wrong.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Batch": {
        "type": "object",
        "description": "Batch is a batch and how far it is.",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "endpoint": {
            "type": "string"
          },
          "input_file_id": {
            "type": "string"
          },
          "completion_window": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "output_file_id": {
            "type": "string"
          },
          "error_file_id": {
            "type": "string"
          },
          "created_at": {
            "type": "integer",
            "format": "int64"
          },
          "in_progress_at": {
            "type": "integer",
            "format": "int64"
          },
          "expires_at": {
            "type": "integer",
            "format": "int64"
          },
          "finalizing_at": {
            "type": "integer",
            "format": "int64"
          },
          "completed_at": {
            "type": "integer",
            "format": "int64"
          },
          "failed_at": {
            "type": "integer",
            "format": "int64"
          },
          "expired_at": {
            "type": "integer",
            "format": "int64"
          },
          "cancelling_at": {
            "type": "integer",
            "format": "int64"
          },
          "cancelled_at": {
            "type": "integer",
            "format": "int64"
          },
          "request_counts": {
            "$ref": "#/components/schemas/RequestCounts"
          },
          "errors": {
            "description": "Any JSON value."
          },
          "metadata": {
            "description": "Any JSON value."
          }
        }
      },
      "BatchList": {
        "type": "object",
        "description": "BatchList is the caller's batches.",
        "properties": {
          "object": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Batch"
            }
          },
          "has_more": {
            "type": "boolean"
          }
        }
      },
      "BatchRequest": {
        "type": "object",
        "description": "BatchRequest runs a file of requests, at the lowest priority.",
        "properties": {
          "input_file_id": {
            "type": "string"
          },
          "endpoint": {
            "type": "string",
            "description": "Endpoint is /v1/chat/completions, /v1/completions or /v1/embeddings."
          },
          "completion_window": {
            "type": "string",
            "description": "CompletionWindow is 24h."
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "ChatChoice": {
        "type": "object",
        "description": "ChatChoice is one answer.",
        "properties": {
          "index": {
            "type": "integer"
          },
          "message": {
            "$ref": "#/components/schemas/ChatMessage"
          },
          "finish_reason": {
            "type": "string",
            "description": "FinishReason is stop, length or tool_calls."
          }
        }
      },
      "ChatCompletion": {
        "type": "object",
        "description": "ChatCompletion is a model's answer.",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "created": {
            "type": "integer",
            "format": "int64"
          },
          "model": {
            "type": "string"
          },
          "choices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatChoice"
            }
          },
          "usage": {
            "$ref": "#/components/schemas/Usage"
          }
        }
      },
      "ChatCompletionRequest": {
        "type": "object",
        "description": "ChatCompletionRequest is a chat turn asked of a model.",
        "properties": {
          "model": {
            "type": "string",
            "description": "Model is a model's name or alias, or an adapter's name."
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatMessage"
            }
          },
          "stream": {
            "type": "boolean",
            "description": "Stream answers as server-sent events."
          },
          "stream_options": {
            "$ref": "#/components/schemas/StreamOptions"
          },
          "max_tokens": {
            "type": "integer"
          },
          "max_completion_tokens": {
            "type": "integer"
          },
          "temperature": {
            "type": "number"
          },
          "top_p": {
            "type": "number"
          },
          "seed": {
            "type": "integer",
            "format": "int64"
          },
          "stop": {
            "description": "Stop is a string or a list of them.\n\nAny JSON value."
          },
          "tools": {
            "description": "Any JSON value."
          },
          "tool_choice": {
            "description": "Any JSON value."
          },
          "response_format": {
            "description": "Any JSON value."
          },
          "user": {
            "type": "string",
            "description": "User is the client's own name for whoever it serves, kept with the usage."
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Metadata are tags kept with the usage, never sent to the engine."
          }
        }
      },
      "ChatMessage": {
        "type": "object",
        "description": "ChatMessage is one turn.",
        "properties": {
          "role": {
            "type": "string",
            "description": "Role is system, user, assistant or tool."
          },
          "content": {
            "description": "Content is a string, or a list of parts: text, and image_url for a model with vision.\n\nAny JSON value."
          },
          "name": {
            "type": "string"
          },
          "tool_calls": {
            "description": "Any JSON value."
          },
          "tool_call_id": {
            "type": "string"
          }
        }
      },
      "Completion": {
        "type": "object",
        "description": "Completion is a continued prompt.",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "created": {
            "type": "integer",
            "format": "int64"
          },
          "model": {
            "type": "string"
          },
          "choices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CompletionChoice"
            }
          },
          "usage": {
            "$ref": "#/components/schemas/Usage"
          }
        }
      },
      "CompletionChoice": {
        "type": "object",
        "description": "CompletionChoice is one continuation.",
        "properties": {
          "index": {
            "type": "integer"
          },
          "text": {
            "type": "string"
          },
          "finish_reason": {
            "type": "string"
          }
        }
      },
      "CompletionRequest": {
        "type": "object",
        "description": "CompletionRequest is a prompt to continue.",
        "properties": {
          "model": {
            "type": "string"
          },
          "prompt": {
            "description": "Prompt is a string or a list of them.\n\nAny JSON value."
          },
          "max_tokens": {
            "type": "integer"
          },
          "temperature": {
            "type": "number"
          },
          "stream": {
            "type": "boolean"
          },
          "stop": {
            "description": "Any JSON value."
          },
          "seed": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "Deleted": {
        "type": "object",
        "description": "Deleted says a thing is gone.",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "deleted": {
            "type": "boolean"
          }
        }
      },
      "Embedding": {
        "type": "object",
        "description": "Embedding is one input's vector.",
        "properties": {
          "object": {
            "type": "string"
          },
          "index": {
            "type": "integer"
          },
          "embedding": {
            "type": "array",
            "items": {
              "type": "number"
            }
          }
        }
      },
      "EmbeddingList": {
        "type": "object",
        "description": "EmbeddingList is every input's vector.",
        "properties": {
          "object": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Embedding"
            }
          },
          "model": {
            "type": "string"
          },
          "usage": {
            "$ref": "#/components/schemas/Usage"
          }
        }
      },
      "EmbeddingRequest": {
        "type": "object",
        "description": "EmbeddingRequest asks for vectors.",
        "properties": {
          "model": {
            "type": "string"
          },
          "input": {
            "description": "Input is a string or a list of them; each is embedded on its own, and the longest must fit the model's context.\n\nAny JSON value."
          },
          "encoding_format": {
            "type": "string"
          },
          "dimensions": {
            "type": "integer"
          }
        }
      },
      "Error": {
        "type": "object",
        "description": "Error is every refusal: OpenAI's shape.",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorBody"
          }
        }
      },
      "ErrorBody": {
        "type": "object",
        "description": "ErrorBody says why.",
        "properties": {
          "message": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "description": "Type is invalid_request_error, server_error, rate_limit_exceeded …"
          },
          "code": {
            "type": "string",
            "description": "Code, where there is one a client branches on: model_not_found, content_policy_violation, job_not_found, system_stopped."
          }
        }
      },
      "File": {
        "type": "object",
        "description": "File is a file kept: a batch's input or output, a job's result.",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "bytes": {
            "type": "integer",
            "format": "int64"
          },
          "created_at": {
            "type": "integer",
            "format": "int64"
          },
          "filename": {
            "type": "string"
          },
          "purpose": {
            "type": "string",
            "description": "Purpose is batch, batch_output or job_output."
          },
          "status": {
            "type": "string"
          },
          "expires_at": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "FileForm": {
        "type": "object",
        "description": "FileForm is a file uploaded, as a form.",
        "properties": {
          "file": {
            "type": "string",
            "contentEncoding": "base64"
          },
          "purpose": {
            "type": "string",
            "description": "Purpose is batch for a batch's input."
          }
        }
      },
      "FileList": {
        "type": "object",
        "description": "FileList is the caller's files.",
        "properties": {
          "object": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/File"
            }
          }
        }
      },
      "Image": {
        "type": "object",
        "description": "Image is one picture.",
        "properties": {
          "b64_json": {
            "type": "string"
          }
        }
      },
      "ImageRequest": {
        "type": "object",
        "description": "ImageRequest asks for pictures, of a model that makes them.",
        "properties": {
          "model": {
            "type": "string"
          },
          "prompt": {
            "type": "string"
          },
          "n": {
            "type": "integer",
            "description": "N is how many, at most 4."
          },
          "size": {
            "type": "string",
            "description": "Size is WIDTHxHEIGHT, each a multiple of 16 from 256 to 2048."
          },
          "response_format": {
            "type": "string",
            "description": "ResponseFormat is b64_json, the only one offered."
          },
          "seed": {
            "type": "integer",
            "format": "int64"
          },
          "steps": {
            "type": "integer"
          },
          "negative_prompt": {
            "type": "string"
          },
          "guidance": {
            "type": "number"
          }
        }
      },
      "ImagesResponse": {
        "type": "object",
        "description": "ImagesResponse is the pictures made; x-llmgw-seed says the seed.",
        "properties": {
          "created": {
            "type": "integer",
            "format": "int64"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Image"
            }
          }
        }
      },
      "Job": {
        "type": "object",
        "description": "Job is a 3D model asked for: its status, progress and, when done, the file its result is in.",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "endpoint": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "Status is queued, running, cancelling, completed, failed, cancelled or expired."
          },
          "progress": {
            "$ref": "#/components/schemas/JobProgress"
          },
          "output_file_id": {
            "type": "string"
          },
          "content_type": {
            "type": "string"
          },
          "error": {
            "$ref": "#/components/schemas/ErrorBody"
          },
          "created_at": {
            "type": "integer",
            "format": "int64"
          },
          "started_at": {
            "type": "integer",
            "format": "int64"
          },
          "finished_at": {
            "type": "integer",
            "format": "int64"
          },
          "expires_at": {
            "type": "integer",
            "format": "int64"
          },
          "usage": {
            "$ref": "#/components/schemas/JobUsage"
          },
          "license": {
            "$ref": "#/components/schemas/License"
          }
        }
      },
      "JobList": {
        "type": "object",
        "description": "JobList is the caller's jobs.",
        "properties": {
          "object": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Job"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "first_id": {
            "type": "string"
          },
          "last_id": {
            "type": "string"
          }
        }
      },
      "JobProgress": {
        "type": "object",
        "description": "JobProgress is how far along a job is.",
        "properties": {
          "state": {
            "type": "string",
            "description": "State is queued, running, done or failed."
          },
          "ahead": {
            "type": "integer",
            "description": "Ahead is how many wait before it, while queued."
          },
          "node_class": {
            "type": "string"
          },
          "step": {
            "type": "integer"
          },
          "steps": {
            "type": "integer"
          },
          "percent": {
            "type": "integer"
          }
        }
      },
      "JobUsage": {
        "type": "object",
        "description": "JobUsage is what a finished job used.",
        "properties": {
          "prompt_tokens": {
            "type": "integer",
            "format": "int64"
          },
          "completion_tokens": {
            "type": "integer",
            "format": "int64"
          },
          "images": {
            "type": "integer",
            "format": "int64"
          },
          "meshes": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "KBDeleted": {
        "type": "object",
        "description": "KBDeleted says a document left a collection.",
        "properties": {
          "name": {
            "type": "string"
          },
          "deleted": {
            "type": "boolean"
          }
        }
      },
      "License": {
        "type": "object",
        "description": "License is the terms what a model makes comes under.",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID is SPDX where there is one, else the licence's own short name."
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "notice": {
            "type": "string"
          },
          "commercial": {
            "type": "boolean",
            "description": "Commercial is whether the output may be used commercially; absent is not said."
          },
          "excluded_regions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "ExcludedRegions are ISO 3166 codes, EU for the union, where it grants nothing."
          },
          "revenue_cap_usd": {
            "type": "integer",
            "format": "int64"
          },
          "attribution": {
            "type": "string"
          }
        }
      },
      "MCPRequest": {
        "type": "object",
        "description": "MCPRequest is a JSON-RPC 2.0 call to the gateway's MCP server: its tools are the memory notes.",
        "properties": {
          "jsonrpc": {
            "type": "string"
          },
          "id": {
            "description": "Any JSON value."
          },
          "method": {
            "type": "string"
          },
          "params": {
            "description": "Any JSON value."
          }
        }
      },
      "Me": {
        "type": "object",
        "description": "Me is the caller as the gateway sees it: its key, place and limits.",
        "properties": {
          "authenticated": {
            "type": "boolean"
          },
          "key_id": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "project": {
            "type": "string"
          },
          "team": {
            "type": "string"
          },
          "organization": {
            "type": "string"
          },
          "limits": {
            "description": "Limits and Usage are what applies and what has been used of it.\n\nAny JSON value."
          },
          "usage": {
            "description": "Any JSON value."
          }
        }
      },
      "MemoryList": {
        "type": "object",
        "description": "MemoryList is the project's notes.",
        "properties": {
          "object": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MemoryNote"
            }
          }
        }
      },
      "MemoryNote": {
        "type": "object",
        "description": "MemoryNote is a note kept.",
        "properties": {
          "key": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        }
      },
      "MemoryWrite": {
        "type": "object",
        "description": "MemoryWrite is a note kept for the caller's project.",
        "properties": {
          "text": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "MeshRequest": {
        "type": "object",
        "description": "MeshRequest asks for a 3D model from a picture, of a model that makes them: a job.",
        "properties": {
          "model": {
            "type": "string"
          },
          "image": {
            "type": "string",
            "description": "Image is the picture, base64 or a data URL: PNG, JPEG or WebP, one object on a plain background."
          },
          "seed": {
            "type": "integer",
            "format": "int64"
          },
          "steps": {
            "type": "integer"
          },
          "resolution": {
            "type": "integer",
            "description": "Resolution is the model's grid, a multiple of 32 from 64 to 2048."
          }
        }
      },
      "MessagesRequest": {
        "type": "object",
        "description": "MessagesRequest is Anthropic's Messages API, translated to chat completions.",
        "properties": {
          "model": {
            "type": "string"
          },
          "messages": {
            "description": "Any JSON value."
          },
          "system": {
            "description": "Any JSON value."
          },
          "max_tokens": {
            "type": "integer"
          },
          "stream": {
            "type": "boolean"
          },
          "tools": {
            "description": "Any JSON value."
          }
        }
      },
      "ModelInfo": {
        "type": "object",
        "description": "ModelInfo is a model a key may use.",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "created": {
            "type": "integer",
            "format": "int64"
          },
          "owned_by": {
            "type": "string"
          },
          "loaded": {
            "type": "boolean",
            "description": "Loaded is whether a replica is up now; a model that loads when asked is listed asleep too, and its first request waits for it to load."
          },
          "context_length": {
            "type": "integer",
            "description": "ContextLength and MaxOutputTokens, where the catalog says."
          },
          "max_output_tokens": {
            "type": "integer"
          },
          "description": {
            "type": "string"
          },
          "capabilities": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            },
            "description": "Capabilities: tools, vision, embeddings, images, meshes, workflows."
          },
          "license": {
            "$ref": "#/components/schemas/License"
          },
          "workflow": {
            "$ref": "#/components/schemas/WorkflowInfo",
            "description": "Workflow is what a ComfyUI model takes and makes."
          }
        }
      },
      "ModelList": {
        "type": "object",
        "description": "ModelList is the models a key may use.",
        "properties": {
          "object": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModelInfo"
            }
          }
        }
      },
      "ModerationRequest": {
        "type": "object",
        "description": "ModerationRequest asks the guardrails' judge.",
        "properties": {
          "input": {
            "description": "Input is a string or up to 32 of them.\n\nAny JSON value."
          },
          "model": {
            "type": "string"
          }
        }
      },
      "ModerationResponse": {
        "type": "object",
        "description": "ModerationResponse is every input's verdict.",
        "properties": {
          "id": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModerationResult"
            }
          }
        }
      },
      "ModerationResult": {
        "type": "object",
        "description": "ModerationResult is one input's verdict.",
        "properties": {
          "flagged": {
            "type": "boolean"
          },
          "categories": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            }
          },
          "category_scores": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            }
          }
        }
      },
      "RequestCounts": {
        "type": "object",
        "description": "RequestCounts is how a batch's lines went.",
        "properties": {
          "total": {
            "type": "integer"
          },
          "completed": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          }
        }
      },
      "RerankRequest": {
        "type": "object",
        "description": "RerankRequest orders documents by a query, for a reranker vLLM serves.",
        "properties": {
          "model": {
            "type": "string"
          },
          "query": {
            "type": "string"
          },
          "documents": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "top_n": {
            "type": "integer"
          }
        }
      },
      "ResponsesRequest": {
        "type": "object",
        "description": "ResponsesRequest is OpenAI's Responses API, translated to chat completions.",
        "properties": {
          "model": {
            "type": "string"
          },
          "input": {
            "description": "Input is a string or a list of items: messages, function calls and their outputs.\n\nAny JSON value."
          },
          "instructions": {
            "type": "string"
          },
          "stream": {
            "type": "boolean"
          },
          "tools": {
            "description": "Any JSON value."
          },
          "text": {
            "description": "Text carries format: a JSON schema the answer follows.\n\nAny JSON value."
          },
          "max_output_tokens": {
            "type": "integer"
          }
        }
      },
      "RunRequest": {
        "type": "object",
        "description": "RunRequest asks a ComfyUI model to run its workflow.",
        "properties": {
          "model": {
            "type": "string"
          },
          "inputs": {
            "type": "object",
            "additionalProperties": {},
            "description": "Inputs are by name, as the model's workflow lists them in /v1/models."
          },
          "seed": {
            "type": "integer",
            "format": "int64",
            "description": "Seed is the workflow's {{seed}}, where it has one; random otherwise."
          }
        }
      },
      "ScoreRequest": {
        "type": "object",
        "description": "ScoreRequest scores pairs of texts, for a scorer vLLM serves.",
        "properties": {
          "model": {
            "type": "string"
          },
          "text_1": {
            "description": "TextA and TextB are strings or lists of them.\n\nAny JSON value."
          },
          "text_2": {
            "description": "Any JSON value."
          }
        }
      },
      "StreamOptions": {
        "type": "object",
        "description": "StreamOptions asks for usage in the last chunk of a stream.",
        "properties": {
          "include_usage": {
            "type": "boolean"
          }
        }
      },
      "TokenCount": {
        "type": "object",
        "description": "TokenCount is how many tokens a Messages request would be.",
        "properties": {
          "input_tokens": {
            "type": "integer"
          }
        }
      },
      "Transcription": {
        "type": "object",
        "description": "Transcription is the text.",
        "properties": {
          "text": {
            "type": "string"
          }
        }
      },
      "TranscriptionForm": {
        "type": "object",
        "description": "TranscriptionForm is speech to text, sent as a form.",
        "properties": {
          "file": {
            "type": "string",
            "contentEncoding": "base64",
            "description": "File is the audio."
          },
          "model": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "prompt": {
            "type": "string"
          },
          "response_format": {
            "type": "string"
          },
          "temperature": {
            "type": "number"
          }
        }
      },
      "Usage": {
        "type": "object",
        "description": "Usage is what a request used.",
        "properties": {
          "prompt_tokens": {
            "type": "integer"
          },
          "completion_tokens": {
            "type": "integer"
          },
          "total_tokens": {
            "type": "integer"
          }
        }
      },
      "WorkflowInfo": {
        "type": "object",
        "description": "WorkflowInfo is what a ComfyUI model takes and makes, for a run at /v1/workflows/runs.",
        "properties": {
          "output": {
            "type": "string",
            "description": "Output is pictures, meshes, video, audio or files."
          },
          "inputs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkflowInput"
            }
          }
        }
      },
      "WorkflowInput": {
        "type": "object",
        "description": "WorkflowInput is one input a workflow takes.",
        "properties": {
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "description": "Type is text, int, float, bool, choice, image, mask, audio, video or file; the last five are sent as base64, a data URL, or a file's id."
          },
          "required": {
            "type": "boolean"
          },
          "default": {},
          "min": {
            "type": "number"
          },
          "max": {
            "type": "number"
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "max_mb": {
            "type": "integer"
          },
          "doc": {
            "type": "string"
          }
        }
      },
      "router.KBCollectionView": {
        "type": "object",
        "description": "KBCollectionView is a collection as a caller sees it.",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "owner": {
            "type": "string",
            "description": "Owner is the owning scope as scope:ID; OwnerName how people know it, \"Acme / hr\"."
          },
          "owner_name": {
            "type": "string"
          },
          "embed_model": {
            "type": "string"
          },
          "dims": {
            "type": "integer"
          },
          "writable": {
            "type": "boolean",
            "description": "Writable is whether this caller may add and remove documents."
          },
          "server_embeds": {
            "type": "boolean",
            "description": "ServerEmbeds says a document may be sent as text alone: the gateway embeds its chunks, as the caller, with the collection's model."
          }
        }
      },
      "router.KBDocumentView": {
        "type": "object",
        "description": "KBDocumentView is a document as the manifest lists it.",
        "properties": {
          "name": {
            "type": "string"
          },
          "digest": {
            "type": "string"
          },
          "bytes": {
            "type": "integer",
            "format": "int64"
          },
          "chunks": {
            "type": "integer"
          },
          "added_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "router.KBManifest": {
        "type": "object",
        "description": "KBManifest is a collection and its documents: what a sync compares the files on disk with.",
        "properties": {
          "collection": {
            "$ref": "#/components/schemas/router.KBCollectionView"
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/router.KBDocumentView"
            }
          }
        }
      },
      "router.KBPutDocument": {
        "type": "object",
        "description": "KBPutDocument is one document, read and embedded by the client.",
        "properties": {
          "name": {
            "type": "string"
          },
          "digest": {
            "type": "string"
          },
          "bytes": {
            "type": "integer",
            "format": "int64"
          },
          "chunks": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "text": {
                  "type": "string"
                },
                "embedding": {
                  "type": "array",
                  "items": {
                    "type": "number"
                  }
                }
              }
            }
          }
        }
      },
      "router.KBPutResult": {
        "type": "object",
        "description": "KBPutResult is what adding a document did.",
        "properties": {
          "name": {
            "type": "string"
          },
          "chunks": {
            "type": "integer"
          },
          "changed": {
            "type": "boolean"
          }
        }
      }
    }
  }
}
