agent-runtime-http-api 0.1.0

Internal HTTP API contract for Agent Runtime
Documentation
{
  "openapi": "3.1.0",
  "info": {"title": "Runtime Domain API", "version": "3.0.0"},
  "security": [{"bearerAuth": []}],
  "paths": {
    "/livez": {"get": {"security": [], "responses": {"200": {"description": "Process is live"}}}},
    "/readyz": {"get": {"security": [], "responses": {"200": {"description": "Runtime is ready"}, "503": {"description": "Dependency is not ready"}}}},
    "/v1/executions": {
      "post": {
        "parameters": [{"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "minLength": 1, "maxLength": 256}}],
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateExecutionRequest"}}}},
        "responses": {"202": {"description": "Execution accepted", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateExecutionResponse"}}}}, "400": {"$ref": "#/components/responses/Error"}, "401": {"$ref": "#/components/responses/Error"}, "409": {"$ref": "#/components/responses/Error"}, "429": {"$ref": "#/components/responses/Error"}}
      }
    },
    "/v1/executions/{executionId}": {
      "get": {"parameters": [{"$ref": "#/components/parameters/ExecutionId"}], "responses": {"200": {"description": "Execution", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ExecutionView"}}}}, "404": {"$ref": "#/components/responses/Error"}}}
    },
    "/v1/executions/{executionId}/events": {
      "get": {"parameters": [{"$ref": "#/components/parameters/ExecutionId"}, {"name": "after", "in": "query", "schema": {"type": "integer", "minimum": 0}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 1000}}], "responses": {"200": {"description": "Committed event page"}, "404": {"$ref": "#/components/responses/Error"}}}
    },
    "/v1/executions/{executionId}/stream": {
      "get": {"parameters": [{"$ref": "#/components/parameters/ExecutionId"}, {"name": "after", "in": "query", "schema": {"type": "integer", "minimum": 0}}], "responses": {"200": {"description": "Committed execution event stream", "content": {"text/event-stream": {"schema": {"type": "string"}}}}}}
    },
    "/v1/executions/{executionId}/inputs": {
      "post": {"parameters": [{"$ref": "#/components/parameters/ExecutionId"}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SubmitInputRequest"}}}}, "responses": {"200": {"description": "Input committed"}, "409": {"$ref": "#/components/responses/Error"}}}
    },
    "/v1/executions/{executionId}/cancel": {
      "post": {"parameters": [{"$ref": "#/components/parameters/ExecutionId"}], "responses": {"200": {"description": "Cancellation committed"}, "404": {"$ref": "#/components/responses/Error"}}}
    }
  },
  "components": {
    "securitySchemes": {"bearerAuth": {"type": "http", "scheme": "bearer"}},
    "parameters": {"ExecutionId": {"name": "executionId", "in": "path", "required": true, "schema": {"type": "string", "minLength": 1, "maxLength": 128}}},
    "responses": {"Error": {"description": "Runtime error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApiError"}}}}},
    "schemas": {
      "RuntimeInput": {"oneOf": [
        {"type": "object", "additionalProperties": false, "required": ["type", "text"], "properties": {"type": {"const": "user_message"}, "text": {"type": "string", "minLength": 1, "maxLength": 1048576}}},
        {"type": "object", "additionalProperties": false, "required": ["type", "requestId", "approved"], "properties": {"type": {"const": "tool_approval"}, "requestId": {"type": "string"}, "approved": {"type": "boolean"}}},
        {"type": "object", "additionalProperties": false, "required": ["type", "requestId", "text"], "properties": {"type": {"const": "elicitation_response"}, "requestId": {"type": "string"}, "text": {"type": "string"}}}
      ]},
      "ExecutionOptions": {"type": "object", "additionalProperties": false, "properties": {"deadlineSeconds": {"type": "integer", "minimum": 1, "maximum": 3600, "default": 900}, "maxModelTurns": {"type": "integer", "minimum": 1, "maximum": 256, "default": 64}, "maxToolCalls": {"type": "integer", "minimum": 1, "maximum": 2048, "default": 256}}},
      "CreateExecutionRequest": {"type": "object", "additionalProperties": false, "required": ["runtimeInstanceId", "input"], "properties": {"runtimeInstanceId": {"type": "string"}, "conversationId": {"type": "string"}, "input": {"$ref": "#/components/schemas/RuntimeInput"}, "options": {"$ref": "#/components/schemas/ExecutionOptions"}}},
      "CreateExecutionResponse": {"type": "object", "additionalProperties": false, "required": ["execution", "replayed"], "properties": {"execution": {"$ref": "#/components/schemas/ExecutionView"}, "replayed": {"type": "boolean"}}},
      "ExecutionOutcome": {"type": "object", "additionalProperties": false, "required": ["answer", "modelTurns", "toolCalls", "inputTokens", "outputTokens"], "properties": {"answer": {"type": "string"}, "modelTurns": {"type": "integer", "minimum": 0}, "toolCalls": {"type": "integer", "minimum": 0}, "inputTokens": {"type": ["integer", "null"], "minimum": 0}, "outputTokens": {"type": ["integer", "null"], "minimum": 0}}},
      "ExecutionView": {"type": "object", "additionalProperties": false, "required": ["id", "runtimeInstanceId", "state", "outcome", "failure", "createdAtMs", "updatedAtMs"], "properties": {"id": {"type": "string"}, "runtimeInstanceId": {"type": "string"}, "conversationId": {"type": ["string", "null"]}, "state": {"enum": ["queued", "running", "waiting_for_input", "finalizing", "completed", "failed", "canceled"]}, "outcome": {"oneOf": [{"type": "null"}, {"$ref": "#/components/schemas/ExecutionOutcome"}]}, "failure": {"type": ["object", "null"]}, "createdAtMs": {"type": "integer"}, "updatedAtMs": {"type": "integer"}}},
      "SubmitInputRequest": {"type": "object", "additionalProperties": false, "required": ["operationId", "input"], "properties": {"operationId": {"type": "string"}, "input": {"$ref": "#/components/schemas/RuntimeInput"}}},
      "ApiError": {"type": "object", "additionalProperties": false, "required": ["code", "message"], "properties": {"code": {"type": "string"}, "message": {"type": "string"}, "requestId": {"type": "string"}, "details": {"type": "object"}}}
    }
  }
}