{
  "openapi": "3.1.0",
  "info": {
    "title": "Orpheus streaming server",
    "version": "0.1.0"
  },
  "paths": {
    "/chat": {
      "post": {
        "summary": "Stream Chat Worker",
        "description": "Orchestrate chat streaming - delegates to single-responsibility functions",
        "operationId": "stream_chat_worker_chat_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatRequestBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/chat-history/{session_id}": {
      "get": {
        "summary": "Get Chat History",
        "description": "Modal worker for Orpheus chat history",
        "operationId": "get_chat_history_chat_history__session_id__get",
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Session Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/session-history": {
      "get": {
        "summary": "Get Session History",
        "operationId": "get_session_history_session_history_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/register-session": {
      "post": {
        "summary": "Register Session",
        "operationId": "register_session_register_session_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterSessionRequestBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/presets": {
      "get": {
        "summary": "Get Session Presets",
        "description": "Modal worker for Orpheus session presets",
        "operationId": "get_session_presets_presets_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/context-state": {
      "post": {
        "summary": "Register State Change",
        "operationId": "register_state_change_context_state_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContextStateRequestBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/session/{session_id}": {
      "post": {
        "summary": "Update Session Metadata",
        "description": "Modal worker for Orpheus chat history",
        "operationId": "update_session_metadata_session__session_id__post",
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Session Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSessionMetadataBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "Get Session Metadata",
        "operationId": "get_session_metadata_session__session_id__get",
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Session Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/message/like-status": {
      "post": {
        "summary": "Update Message Like Status",
        "description": "Modal worker for Orpheus chat history",
        "operationId": "update_message_like_status_message_like_status_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMessageLikeStatusBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/ably-auth": {
      "get": {
        "summary": "Get Ably Auth Token",
        "operationId": "get_ably_auth_token_ably_auth_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/select-ab-response": {
      "post": {
        "summary": "Select Ab Response",
        "description": "Mark one A/B test response as preferred",
        "operationId": "select_ab_response_select_ab_response_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SelectABResponseRequestBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/content": {
      "get": {
        "summary": "Get Static Content",
        "operationId": "get_static_content_content_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/session-id/{workspace_id}": {
      "get": {
        "summary": "Get Session Id For Workspace",
        "operationId": "get_session_id_for_workspace_session_id__workspace_id__get",
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Workspace Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ChatHistoryItem": {
        "properties": {
          "role": {
            "type": "string",
            "title": "Role"
          },
          "content": {
            "type": "string",
            "title": "Content"
          },
          "tool_call_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Call Id"
          },
          "tool_calls": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ToolCall"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Calls"
          }
        },
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "title": "ChatHistoryItem"
      },
      "ChatRequestBody": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          },
          "message_id": {
            "type": "string",
            "title": "Message Id"
          },
          "session_id": {
            "type": "string",
            "title": "Session Id"
          },
          "referenced_clip_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Referenced Clip Id"
          },
          "referenced_styles": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Referenced Styles"
          },
          "referenced_lyrics": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Referenced Lyrics"
          },
          "styles_full_context": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Styles Full Context"
          },
          "lyrics_full_context": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lyrics Full Context"
          },
          "tool_call_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Call Id"
          },
          "chat_history": {
            "items": {
              "$ref": "#/components/schemas/ChatHistoryItem"
            },
            "type": "array",
            "title": "Chat History",
            "default": []
          },
          "is_retry": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Retry"
          },
          "variant": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Variant",
            "default": "default"
          },
          "store_history_only": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Store History Only",
            "default": false
          },
          "role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role"
          },
          "clip_ids": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Clip Ids"
          },
          "ab_test_probability": {
            "type": "number",
            "title": "Ab Test Probability",
            "default": 0.01
          },
          "locale": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Locale"
          },
          "platform": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Platform"
          }
        },
        "type": "object",
        "required": [
          "message",
          "message_id",
          "session_id"
        ],
        "title": "ChatRequestBody"
      },
      "ContextStateRequestBody": {
        "properties": {
          "session_id": {
            "type": "string",
            "title": "Session Id"
          },
          "type": {
            "type": "string",
            "title": "Type"
          },
          "metadata": {
            "title": "Metadata"
          }
        },
        "type": "object",
        "required": [
          "session_id",
          "type",
          "metadata"
        ],
        "title": "ContextStateRequestBody"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "RegisterSessionRequestBody": {
        "properties": {
          "session_id": {
            "type": "string",
            "title": "Session Id"
          },
          "workspace_id": {
            "type": "string",
            "title": "Workspace Id"
          },
          "creation_source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Creation Source"
          }
        },
        "type": "object",
        "required": [
          "session_id",
          "workspace_id"
        ],
        "title": "RegisterSessionRequestBody"
      },
      "SelectABResponseRequestBody": {
        "properties": {
          "session_id": {
            "type": "string",
            "title": "Session Id"
          },
          "ab_test_group_id": {
            "type": "string",
            "title": "Ab Test Group Id"
          },
          "preferred_ab_variant": {
            "type": "string",
            "enum": [
              "A",
              "B"
            ],
            "title": "Preferred Ab Variant"
          }
        },
        "type": "object",
        "required": [
          "session_id",
          "ab_test_group_id",
          "preferred_ab_variant"
        ],
        "title": "SelectABResponseRequestBody",
        "description": "A/B Response Body records user's preference for A or B"
      },
      "ToolCall": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "type": {
            "type": "string",
            "title": "Type"
          },
          "function": {
            "$ref": "#/components/schemas/ToolCallFunction"
          }
        },
        "type": "object",
        "required": [
          "id",
          "type",
          "function"
        ],
        "title": "ToolCall"
      },
      "ToolCallFunction": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "arguments": {
            "title": "Arguments"
          }
        },
        "type": "object",
        "required": [
          "name",
          "arguments"
        ],
        "title": "ToolCallFunction"
      },
      "UpdateMessageLikeStatusBody": {
        "properties": {
          "like_status": {
            "enum": [
              "like",
              "dislike",
              null
            ],
            "title": "Like Status"
          },
          "session_id": {
            "type": "string",
            "title": "Session Id"
          },
          "message_id": {
            "type": "string",
            "title": "Message Id"
          }
        },
        "type": "object",
        "required": [
          "like_status",
          "session_id",
          "message_id"
        ],
        "title": "UpdateMessageLikeStatusBody"
      },
      "UpdateSessionMetadataBody": {
        "properties": {
          "metadata_key": {
            "type": "string",
            "title": "Metadata Key"
          },
          "metadata_value": {
            "title": "Metadata Value"
          }
        },
        "type": "object",
        "required": [
          "metadata_key",
          "metadata_value"
        ],
        "title": "UpdateSessionMetadataBody"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    }
  }
}
