Skip to content

HarnessRouter Community Edition: the self-hosted, Apache-2.0 edition of the unified interface for agent harnesses. Run Codex, Claude Code, Hermes, PI, DSH, and more through one API, with sessions, streaming, files, cancellation, and failure handling. Implements the Unified Harness Protocol (UHP), an open standard. Your keys, your infrastructure.

27.3 KB
Raw Blame
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://unifiedharnessprotocol.org/schema/uhp-2026-08-11.schema.json",
  "title": "Unified Harness Protocol",
  "description": "Object definitions for UHP 2026-08-11. Generated from uhp-2026-08-11.openapi.yaml by build.py — do not edit by hand.",
  "$defs": {
    "Discovery": {
      "type": "object",
      "required": [
        "object",
        "protocol",
        "versions",
        "default_version",
        "conformance_class",
        "capabilities"
      ],
      "properties": {
        "object": {
          "type": "string",
          "const": "uhp.discovery"
        },
        "protocol": {
          "type": "string",
          "const": "uhp"
        },
        "versions": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string"
          }
        },
        "default_version": {
          "type": "string"
        },
        "conformance_class": {
          "type": "string",
          "enum": [
            "core",
            "extended",
            "full"
          ]
        },
        "capabilities": {
          "$ref": "#/$defs/Capabilities"
        },
        "implementation": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "version": {
              "type": "string"
            }
          },
          "additionalProperties": true
        }
      },
      "additionalProperties": true
    },
    "Capabilities": {
      "type": "object",
      "description": "Named booleans. A server reports `false` for a capability it does not implement rather than\nomitting it, so a client can distinguish \"not supported\" from \"server predates this field\".\nA client treats an absent key as `false`.\n",
      "properties": {
        "streaming": {
          "type": "boolean"
        },
        "sessions": {
          "type": "boolean"
        },
        "cancellation": {
          "type": "boolean"
        },
        "files_input": {
          "type": "boolean"
        },
        "files_output": {
          "type": "boolean"
        },
        "session_listing": {
          "type": "boolean"
        },
        "harness_management": {
          "type": "boolean"
        },
        "session_sharing": {
          "type": "boolean"
        },
        "idempotency": {
          "type": "boolean"
        }
      },
      "additionalProperties": {
        "type": "boolean"
      }
    },
    "Harness": {
      "type": "object",
      "required": [
        "id",
        "name",
        "base"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^chrn_"
        },
        "object": {
          "type": "string",
          "const": "harness"
        },
        "name": {
          "type": "string"
        },
        "base": {
          "type": "string",
          "description": "Opaque. Not enumerated by this specification — a client must treat it as a string, or the\nprotocol would need revising every time a harness is released.\n",
          "examples": [
            "codex",
            "claude-code",
            "hermes"
          ]
        },
        "baseLabel": {
          "type": "string"
        },
        "defaultModel": {
          "type": "string"
        },
        "systemPrompt": {
          "type": "string"
        },
        "mcpServers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/McpServer"
          }
        },
        "skills": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Skill"
          }
        },
        "disabledTools": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "maxStep": {
          "type": [
            "integer",
            "null"
          ]
        },
        "timeoutSeconds": {
          "type": [
            "integer",
            "null"
          ]
        },
        "createdAt": {
          "type": "integer",
          "description": "Unix milliseconds"
        }
      },
      "additionalProperties": true
    },
    "McpServer": {
      "type": "object",
      "required": [
        "name",
        "url"
      ],
      "description": "A remote MCP server attached to a harness. Only enabled entries are connected for a turn; a\ndisabled entry must not be contacted at all. An unreachable server must not fail the task.\n",
      "properties": {
        "name": {
          "type": "string",
          "description": "Sanitised to a CLI-safe identifier by the server."
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "transport": {
          "type": "string",
          "enum": [
            "http",
            "sse"
          ],
          "default": "http"
        },
        "enabled": {
          "type": "boolean",
          "default": true
        },
        "headers": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "auth": {
          "type": "string",
          "description": "Bearer token, or a server-side reference the server resolves. A server must never return\na resolved credential to a client.\n"
        }
      },
      "additionalProperties": true
    },
    "Skill": {
      "type": "object",
      "required": [
        "name"
      ],
      "description": "A skill is a FOLDER, not a file. A server must materialise the whole folder where the agent\ncan read it — materialising only SKILL.md breaks every skill carrying references, scripts or\ndata. Round-tripping a harness through GET and PUT must not lose skill contents.\n",
      "properties": {
        "name": {
          "type": "string"
        },
        "enabled": {
          "type": "boolean",
          "default": true,
          "description": "false suppresses the skill, including one inherited from the base."
        },
        "files": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SkillFile"
          },
          "description": "The bundle. Must contain a SKILL.md."
        },
        "content": {
          "type": "string",
          "description": "Shorthand for a single-file bundle whose only member is SKILL.md."
        },
        "blob": {
          "type": "string",
          "description": "Server-assigned handle for a bundle stored out of line. A client receives it, passes it\nback unchanged, and reads the files from the skill files endpoint.\n"
        }
      },
      "additionalProperties": true
    },
    "SkillFile": {
      "type": "object",
      "required": [
        "path"
      ],
      "properties": {
        "path": {
          "type": "string",
          "description": "Relative to the skill's own folder; nested directories are supported. A server must\nreject a path that escapes the folder.\n",
          "examples": [
            "SKILL.md",
            "references/codes.md",
            "assets/logo.png"
          ]
        },
        "content": {
          "type": "string",
          "description": "Text content."
        },
        "content_b64": {
          "type": "string",
          "description": "Base64 for binary content; preserved byte-for-byte."
        }
      },
      "additionalProperties": true
    },
    "HarnessCreate": {
      "type": "object",
      "required": [
        "base"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "base": {
          "type": "string"
        },
        "default_model": {
          "type": "string"
        },
        "system_prompt": {
          "type": "string"
        },
        "mcp_servers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/McpServer"
          }
        },
        "skills": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Skill"
          }
        },
        "disabled_tools": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "max_step": {
          "type": [
            "integer",
            "null"
          ]
        },
        "timeout_seconds": {
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "additionalProperties": true
    },
    "ModelCatalog": {
      "type": "object",
      "required": [
        "backends"
      ],
      "properties": {
        "backends": {
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "required": [
              "default",
              "models"
            ],
            "properties": {
              "default": {
                "type": "string"
              },
              "models": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/Model"
                }
              }
            }
          }
        }
      }
    },
    "HarnessModels": {
      "type": "object",
      "required": [
        "models"
      ],
      "properties": {
        "harness_id": {
          "type": "string"
        },
        "backend": {
          "type": "string"
        },
        "default": {
          "type": "string"
        },
        "fallback": {
          "type": "string"
        },
        "models": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Model"
          }
        }
      }
    },
    "Model": {
      "type": "object",
      "required": [
        "id",
        "available"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "backend": {
          "type": "string"
        },
        "available": {
          "type": "boolean",
          "description": "Computed, not asserted: true means the server can serve this model for this harness right\nnow. Listing a model as available and then failing the task is the worst outcome for a\nclient, because a user has already chosen it.\n"
        },
        "default": {
          "type": "boolean"
        }
      },
      "additionalProperties": true
    },
    "CreateResponseRequest": {
      "type": "object",
      "required": [
        "input"
      ],
      "properties": {
        "input": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": true
              }
            }
          ],
          "description": "A bare string is shorthand for one user message."
        },
        "model": {
          "type": "string",
          "description": "Canonical model id. Omitted means the harness default."
        },
        "metadata": {
          "type": "object",
          "description": "Client metadata. `harness_id` selects the configured harness.",
          "properties": {
            "harness_id": {
              "type": "string"
            }
          },
          "additionalProperties": true
        },
        "stream": {
          "type": "boolean",
          "default": false
        },
        "previous_response_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "instructions": {
          "type": "string"
        },
        "store": {
          "type": "boolean",
          "default": true
        },
        "max_output_tokens": {
          "type": [
            "integer",
            "null"
          ]
        },
        "max_step": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Agent step (tool-call round) budget"
        },
        "timeout_seconds": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Wall-clock budget"
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true
          },
          "description": "Reserved and ignored. Accepted for wire compatibility, never acted on, and reported in\n`metadata.ignored_fields` on the response. A UHP harness invokes and executes tools\nitself and reports them in `output`; there is no input path for a tool result, so the\nclient-executed tool loop this field implies cannot be completed by a conformant server.\nConfigure tools on the harness instead — see Harnesses §4.1. Tasks §1.4.\n"
        },
        "include": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Reserved and ignored. Accepted for wire compatibility, never acted on, and reported in\n`metadata.ignored_fields` on the response. No values are enumerated, so any string a\nserver recognised would be one it named itself. Tasks §1.4.\n"
        },
        "background": {
          "type": "boolean",
          "default": false
        }
      },
      "additionalProperties": true
    },
    "Response": {
      "type": "object",
      "required": [
        "id",
        "object",
        "created_at",
        "status",
        "output",
        "model"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^resp_"
        },
        "object": {
          "type": "string",
          "const": "response"
        },
        "created_at": {
          "type": "integer",
          "description": "Unix seconds"
        },
        "status": {
          "$ref": "#/$defs/ResponseStatus"
        },
        "error": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/Error"
            }
          ],
          "description": "Non-null only when status is `failed`."
        },
        "incomplete_details": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        },
        "previous_response_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "model": {
          "type": "string",
          "description": "The model that actually ran."
        },
        "output": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/OutputItem"
          }
        },
        "store": {
          "type": "boolean"
        },
        "usage": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "$ref": "#/$defs/Usage"
            }
          ],
          "description": "null when the server cannot account for usage. A fabricated zero would be worse than an\nhonest absence, because a client cannot tell it from a free task.\n"
        },
        "metadata": {
          "type": "object",
          "properties": {
            "session_id": {
              "type": "string"
            },
            "requested_model": {
              "type": "string",
              "description": "Present when the server ran a different model than was requested."
            },
            "model_fallback": {
              "type": "boolean"
            },
            "model_fallback_reason": {
              "type": "string"
            },
            "ignored_fields": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Request fields the server did not act on, by name, in any order. Required when the\nrequest carried `tools` or `include`, which are reserved and ignored. A silently\nignored field is indistinguishable from an honoured one. Tasks §1.1 and §1.4.\n"
            }
          },
          "additionalProperties": true
        }
      },
      "additionalProperties": true
    },
    "ResponseStatus": {
      "type": "string",
      "enum": [
        "in_progress",
        "completed",
        "failed",
        "incomplete",
        "cancelled"
      ],
      "description": "`incomplete` means a budget stopped the work and is usually worth continuing.\n`failed` means it could not be done. `cancelled` means the client asked for a stop, and must\nnever be reported as `failed`.\n"
    },
    "OutputItem": {
      "type": "object",
      "required": [
        "type"
      ],
      "description": "A client must tolerate item types it does not recognise. A client that renders only `message`\nitems and ignores the rest is a valid client.\n",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "examples": [
            "message",
            "reasoning",
            "function_call",
            "function_call_output"
          ]
        },
        "status": {
          "type": "string"
        },
        "role": {
          "type": "string"
        },
        "content": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ContentPart"
          }
        },
        "summary": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "call_id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "arguments": {
          "type": "string",
          "description": "JSON",
          "as a string": null
        },
        "output": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "ContentPart": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "examples": [
            "output_text"
          ]
        },
        "text": {
          "type": "string"
        },
        "annotations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Annotation"
          }
        }
      },
      "additionalProperties": true
    },
    "Annotation": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "const": "container_file_citation"
        },
        "container_id": {
          "type": "string"
        },
        "file_id": {
          "type": "string"
        },
        "filename": {
          "type": "string"
        },
        "download_url": {
          "type": "string",
          "format": "uri"
        },
        "start_index": {
          "type": "integer"
        },
        "end_index": {
          "type": "integer"
        }
      },
      "additionalProperties": true
    },
    "Usage": {
      "type": "object",
      "properties": {
        "input_tokens": {
          "type": "integer",
          "minimum": 0
        },
        "output_tokens": {
          "type": "integer",
          "minimum": 0
        },
        "total_tokens": {
          "type": "integer",
          "minimum": 0
        },
        "cache_read_tokens": {
          "type": "integer",
          "minimum": 0
        },
        "cache_write_tokens": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": true
    },
    "Session": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "object": {
          "type": "string",
          "const": "session"
        },
        "harness_id": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "created_at": {
          "type": "integer"
        },
        "updated_at": {
          "type": "integer"
        }
      },
      "additionalProperties": true
    },
    "SessionList": {
      "type": "object",
      "required": [
        "sessions"
      ],
      "properties": {
        "sessions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Session"
          }
        },
        "next_cursor": {
          "type": [
            "string",
            "null"
          ],
          "description": "null on the last page. A client must not be required to detect the end by receiving fewer\nitems than requested — that heuristic is wrong whenever a page is exactly full.\n"
        }
      },
      "additionalProperties": true
    },
    "File": {
      "type": "object",
      "required": [
        "id",
        "filename"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "object": {
          "type": "string",
          "const": "file"
        },
        "container_id": {
          "type": "string"
        },
        "filename": {
          "type": "string"
        },
        "bytes": {
          "type": "integer",
          "minimum": 0
        },
        "created_at": {
          "type": "integer"
        }
      },
      "additionalProperties": true
    },
    "ErrorEnvelope": {
      "type": "object",
      "required": [
        "error"
      ],
      "properties": {
        "error": {
          "$ref": "#/$defs/Error"
        },
        "detail": {
          "type": "string",
          "deprecated": true,
          "description": "A human-readable alias of `error.message`, retained for clients written against\nimplementations that predate this envelope. Carries no information not in `error`.\n"
        }
      },
      "additionalProperties": true
    },
    "Error": {
      "type": "object",
      "required": [
        "type",
        "code",
        "message"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "invalid_request_error",
            "authentication_error",
            "permission_error",
            "rate_limit_error",
            "harness_error",
            "server_error"
          ]
        },
        "code": {
          "type": "string",
          "description": "Specific and machine-readable. Servers may define additional codes for conditions this\nspecification does not cover, and must namespace them with a vendor prefix so a future\nversion cannot collide with them.\n",
          "examples": [
            "unsupported_protocol_version",
            "invalid_input",
            "harness_not_found",
            "response_not_found",
            "session_not_found",
            "file_not_found",
            "session_expired",
            "harness_mismatch",
            "session_busy",
            "file_too_large",
            "model_unavailable",
            "unsupported_base",
            "missing_credential",
            "invalid_credential",
            "insufficient_scope",
            "rate_limited",
            "quota_exhausted",
            "harness_error",
            "harness_unavailable",
            "provider_error",
            "timeout",
            "cancelled",
            "preview_unavailable",
            "preview_failed"
          ]
        },
        "message": {
          "type": "string",
          "description": "One sentence, safe to show a user. Must not contain credentials, internal hostnames, file\npaths, or stack traces.\n"
        },
        "param": {
          "type": [
            "string",
            "null"
          ],
          "description": "Dotted path to the offending field."
        },
        "detail": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        }
      },
      "additionalProperties": true
    },
    "Event": {
      "type": "object",
      "required": [
        "type",
        "sequence_number"
      ],
      "description": "One streamed event. `sequence_number` starts at 0 and increases by exactly 1 per event, so a\nclient can detect a dropped event rather than silently rendering a gap.\n",
      "properties": {
        "type": {
          "type": "string",
          "examples": [
            "response.created",
            "response.in_progress",
            "response.output_item.added",
            "response.output_item.done",
            "response.content_part.added",
            "response.content_part.done",
            "response.output_text.delta",
            "response.output_text.done",
            "response.output_text.annotation.added",
            "response.reasoning_summary_part.added",
            "response.reasoning_summary_text.delta",
            "response.reasoning_summary_part.done",
            "response.function_call_arguments.delta",
            "response.function_call_arguments.done",
            "response.completed",
            "response.incomplete",
            "response.failed",
            "error"
          ]
        },
        "sequence_number": {
          "type": "integer",
          "minimum": 0
        },
        "response": {
          "$ref": "#/$defs/Response"
        },
        "item": {
          "$ref": "#/$defs/OutputItem"
        },
        "part": {
          "$ref": "#/$defs/ContentPart"
        },
        "annotation": {
          "$ref": "#/$defs/Annotation"
        },
        "delta": {
          "type": "string"
        },
        "text": {
          "type": "string"
        },
        "arguments": {
          "type": "string"
        },
        "item_id": {
          "type": "string"
        },
        "output_index": {
          "type": "integer",
          "minimum": 0
        },
        "content_index": {
          "type": "integer",
          "minimum": 0
        },
        "summary_index": {
          "type": "integer",
          "minimum": 0
        },
        "annotation_index": {
          "type": "integer",
          "minimum": 0
        },
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": true
    },
    "SessionShare": {
      "type": "object",
      "description": "A published read-only view of a session (Sessions §5). `url` may be relative, resolving against the base URL the caller is already using — a server behind a proxy cannot know its public origin, and a base-relative path survives every fronting. The share's id MUST NOT function as a credential for the rest of the API.",
      "required": [
        "id",
        "url"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "object": {
          "type": "string",
          "description": "SHOULD be \"session.share\""
        },
        "enabled": {
          "type": "boolean"
        }
      },
      "additionalProperties": true
    },
    "TurnItem": {
      "type": "object",
      "description": "One turn of a session's history (Sessions §3). Previously an object with no stated shape, which kept every conformance check at 'the endpoint answered 200'.",
      "required": [
        "id",
        "status"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The response id, usable with GET /v1/responses/{id}"
        },
        "status": {
          "type": "string"
        },
        "user": {
          "type": "string"
        },
        "assistant": {
          "type": "string"
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "files": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "additionalProperties": true
    }
  }
}