{
    "openapi": "3.0.2",
    "info": {
        "title": "DatabaseService",
        "version": ""
    },
    "paths": {
        "/db/{databaseId}/embed/{model}": {
            "post": {
                "description": "Embeds input into a vector.",
                "operationId": "Embed",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/EmbedRequestContent"
                            }
                        }
                    },
                    "required": true
                },
                "parameters": [
                    {
                        "name": "databaseId",
                        "in": "path",
                        "schema": {
                            "type": "string",
                            "maxLength": 256,
                            "minLength": 1,
                            "pattern": "^[A-Za-z0-9-_]+$"
                        },
                        "required": true
                    },
                    {
                        "name": "model",
                        "in": "path",
                        "schema": {
                            "$ref": "#/components/schemas/EmbeddingModel"
                        },
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Embed 200 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EmbedResponseContent"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "QuotaExceededException 400 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/QuotaExceededExceptionResponseContent"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "InsufficientFundsException 402 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InsufficientFundsExceptionResponseContent"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "AccessDeniedException 403 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AccessDeniedExceptionResponseContent"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "NotFoundException 404 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/NotFoundExceptionResponseContent"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "ThrottlingError 429 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ThrottlingErrorResponseContent"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "InternalServerError 500 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InternalServerErrorResponseContent"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "ServiceUnavailableError 503 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ServiceUnavailableErrorResponseContent"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/db/{databaseId}/item/{key}": {
            "delete": {
                "description": "Deletes an item from the database.",
                "operationId": "DeleteItem",
                "parameters": [
                    {
                        "name": "databaseId",
                        "in": "path",
                        "schema": {
                            "type": "string",
                            "maxLength": 256,
                            "minLength": 1,
                            "pattern": "^[A-Za-z0-9-_]+$"
                        },
                        "required": true
                    },
                    {
                        "name": "key",
                        "in": "path",
                        "schema": {
                            "type": "string",
                            "maxLength": 256,
                            "minLength": 1
                        },
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "DeleteItem 204 response"
                    },
                    "400": {
                        "description": "QuotaExceededException 400 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/QuotaExceededExceptionResponseContent"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "InsufficientFundsException 402 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InsufficientFundsExceptionResponseContent"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "AccessDeniedException 403 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AccessDeniedExceptionResponseContent"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "NotFoundException 404 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/NotFoundExceptionResponseContent"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "ThrottlingError 429 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ThrottlingErrorResponseContent"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "InternalServerError 500 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InternalServerErrorResponseContent"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "ServiceUnavailableError 503 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ServiceUnavailableErrorResponseContent"
                                }
                            }
                        }
                    }
                }
            },
            "get": {
                "description": "Retrieves a single item from the database.",
                "operationId": "GetItem",
                "parameters": [
                    {
                        "name": "databaseId",
                        "in": "path",
                        "schema": {
                            "type": "string",
                            "maxLength": 256,
                            "minLength": 1,
                            "pattern": "^[A-Za-z0-9-_]+$"
                        },
                        "required": true
                    },
                    {
                        "name": "key",
                        "in": "path",
                        "schema": {
                            "type": "string",
                            "maxLength": 256,
                            "minLength": 1
                        },
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "GetItem 200 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GetItemResponseContent"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "QuotaExceededException 400 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/QuotaExceededExceptionResponseContent"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "InsufficientFundsException 402 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InsufficientFundsExceptionResponseContent"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "AccessDeniedException 403 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AccessDeniedExceptionResponseContent"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "NotFoundException 404 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/NotFoundExceptionResponseContent"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "ThrottlingError 429 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ThrottlingErrorResponseContent"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "InternalServerError 500 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InternalServerErrorResponseContent"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "ServiceUnavailableError 503 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ServiceUnavailableErrorResponseContent"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "description": "Inserts or overwrites an item in the database.",
                "operationId": "SetItem",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SetItemRequestContent"
                            }
                        }
                    },
                    "required": true
                },
                "parameters": [
                    {
                        "name": "databaseId",
                        "in": "path",
                        "schema": {
                            "type": "string",
                            "maxLength": 256,
                            "minLength": 1,
                            "pattern": "^[A-Za-z0-9-_]+$"
                        },
                        "required": true
                    },
                    {
                        "name": "key",
                        "in": "path",
                        "schema": {
                            "type": "string",
                            "maxLength": 256,
                            "minLength": 1
                        },
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "SetItem 204 response"
                    },
                    "400": {
                        "description": "QuotaExceededException 400 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/QuotaExceededExceptionResponseContent"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "InsufficientFundsException 402 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InsufficientFundsExceptionResponseContent"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "AccessDeniedException 403 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AccessDeniedExceptionResponseContent"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "NotFoundException 404 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/NotFoundExceptionResponseContent"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "ThrottlingError 429 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ThrottlingErrorResponseContent"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "InternalServerError 500 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InternalServerErrorResponseContent"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "ServiceUnavailableError 503 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ServiceUnavailableErrorResponseContent"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/db/{databaseId}/items": {
            "post": {
                "description": "Lists items in the database.",
                "operationId": "ListItems",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ListItemsRequestContent"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "databaseId",
                        "in": "path",
                        "schema": {
                            "type": "string",
                            "maxLength": 256,
                            "minLength": 1,
                            "pattern": "^[A-Za-z0-9-_]+$"
                        },
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "ListItems 200 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListItemsResponseContent"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "QuotaExceededException 400 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/QuotaExceededExceptionResponseContent"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "InsufficientFundsException 402 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InsufficientFundsExceptionResponseContent"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "AccessDeniedException 403 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AccessDeniedExceptionResponseContent"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "NotFoundException 404 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/NotFoundExceptionResponseContent"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "ThrottlingError 429 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ThrottlingErrorResponseContent"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "InternalServerError 500 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InternalServerErrorResponseContent"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "ServiceUnavailableError 503 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ServiceUnavailableErrorResponseContent"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/db/{databaseId}/query": {
            "post": {
                "description": "Queries the database for items.",
                "operationId": "Query",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/QueryRequestContent"
                            }
                        }
                    },
                    "required": true
                },
                "parameters": [
                    {
                        "name": "databaseId",
                        "in": "path",
                        "schema": {
                            "type": "string",
                            "maxLength": 256,
                            "minLength": 1,
                            "pattern": "^[A-Za-z0-9-_]+$"
                        },
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Query 200 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/QueryResponseContent"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "QuotaExceededException 400 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/QuotaExceededExceptionResponseContent"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "InsufficientFundsException 402 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InsufficientFundsExceptionResponseContent"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "AccessDeniedException 403 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AccessDeniedExceptionResponseContent"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "NotFoundException 404 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/NotFoundExceptionResponseContent"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "ThrottlingError 429 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ThrottlingErrorResponseContent"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "InternalServerError 500 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InternalServerErrorResponseContent"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "ServiceUnavailableError 503 response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ServiceUnavailableErrorResponseContent"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "AccessDeniedExceptionResponseContent": {
                "type": "object",
                "properties": {
                    "message": {
                        "type": "string"
                    }
                },
                "required": [
                    "message"
                ]
            },
            "EmbedRequestContent": {
                "type": "object",
                "properties": {
                    "input": {
                        "$ref": "#/components/schemas/EmbeddingInput"
                    }
                },
                "required": [
                    "input"
                ]
            },
            "EmbedResponseContent": {
                "type": "object",
                "properties": {
                    "vector": {
                        "type": "array",
                        "items": {
                            "type": "number",
                            "format": "float"
                        },
                        "maxItems": 4096,
                        "minItems": 0
                    },
                    "consumedEmbeddingUnits": {
                        "type": "number"
                    }
                },
                "required": [
                    "vector"
                ]
            },
            "EmbeddingInput": {
                "oneOf": [
                    {
                        "type": "object",
                        "title": "text",
                        "properties": {
                            "text": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "text"
                        ]
                    },
                    {
                        "type": "object",
                        "title": "image",
                        "properties": {
                            "image": {
                                "type": "string",
                                "format": "byte"
                            }
                        },
                        "required": [
                            "image"
                        ]
                    }
                ]
            },
            "EmbeddingModel": {
                "type": "string",
                "enum": [
                    "ALL_MINILM_L6_V2",
                    "CLIP_VIT_BASE_PATH32"
                ]
            },
            "GetItemResponseContent": {
                "type": "object",
                "properties": {
                    "key": {
                        "type": "string",
                        "maxLength": 256,
                        "minLength": 1
                    },
                    "value": {
                        "type": "string",
                        "maxLength": 5120,
                        "minLength": 0,
                        "format": "byte"
                    },
                    "vector": {
                        "type": "array",
                        "items": {
                            "type": "number",
                            "format": "float"
                        },
                        "maxItems": 4096,
                        "minItems": 0
                    },
                    "metadata": {
                        "$ref": "#/components/schemas/Metadata"
                    }
                },
                "required": [
                    "key",
                    "vector"
                ]
            },
            "InsufficientFundsExceptionResponseContent": {
                "type": "object",
                "properties": {
                    "message": {
                        "type": "string"
                    }
                },
                "required": [
                    "message"
                ]
            },
            "InternalServerErrorResponseContent": {
                "type": "object",
                "properties": {
                    "message": {
                        "type": "string"
                    }
                },
                "required": [
                    "message"
                ]
            },
            "Item": {
                "type": "object",
                "properties": {
                    "key": {
                        "type": "string",
                        "maxLength": 256,
                        "minLength": 1
                    },
                    "value": {
                        "type": "string",
                        "maxLength": 5120,
                        "minLength": 0,
                        "format": "byte"
                    },
                    "vector": {
                        "type": "array",
                        "items": {
                            "type": "number",
                            "format": "float"
                        },
                        "maxItems": 4096,
                        "minItems": 0
                    },
                    "metadata": {
                        "$ref": "#/components/schemas/Metadata"
                    }
                },
                "required": [
                    "key",
                    "vector"
                ]
            },
            "ListItemsRequestContent": {
                "type": "object",
                "properties": {
                    "pageSize": {
                        "type": "number",
                        "default": 1000,
                        "maximum": 1000,
                        "minimum": 1
                    },
                    "nextToken": {
                        "type": "string",
                        "maxLength": 2048
                    }
                }
            },
            "ListItemsResponseContent": {
                "type": "object",
                "properties": {
                    "items": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Item"
                        }
                    },
                    "nextToken": {
                        "type": "string"
                    }
                },
                "required": [
                    "items"
                ]
            },
            "Metadata": {
                "type": "object",
                "additionalProperties": {
                    "$ref": "#/components/schemas/MetadataValue"
                }
            },
            "MetadataValue": {
                "oneOf": [
                    {
                        "type": "object",
                        "title": "string",
                        "properties": {
                            "string": {
                                "type": "string",
                                "maxLength": 5120,
                                "minLength": 1
                            }
                        },
                        "required": [
                            "string"
                        ]
                    },
                    {
                        "type": "object",
                        "title": "stringArray",
                        "properties": {
                            "stringArray": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            }
                        },
                        "required": [
                            "stringArray"
                        ]
                    },
                    {
                        "type": "object",
                        "title": "number",
                        "properties": {
                            "number": {
                                "type": "number",
                                "format": "double"
                            }
                        },
                        "required": [
                            "number"
                        ]
                    },
                    {
                        "type": "object",
                        "title": "numberArray",
                        "properties": {
                            "numberArray": {
                                "type": "array",
                                "items": {
                                    "type": "number",
                                    "format": "double"
                                }
                            }
                        },
                        "required": [
                            "numberArray"
                        ]
                    }
                ]
            },
            "NotFoundExceptionResponseContent": {
                "type": "object",
                "properties": {
                    "message": {
                        "type": "string"
                    }
                },
                "required": [
                    "message"
                ]
            },
            "QueryRequestContent": {
                "type": "object",
                "properties": {
                    "maxResults": {
                        "type": "number",
                        "default": 5,
                        "maximum": 1000,
                        "minimum": 1
                    },
                    "query": {
                        "$ref": "#/components/schemas/QueryType"
                    },
                    "filter": {
                        "type": "string",
                        "maxLength": 2048,
                        "description": "Optional lucene-style filter evaluated against item metadata during the query."
                    }
                },
                "required": [
                    "query"
                ]
            },
            "QueryResponseContent": {
                "type": "object",
                "properties": {
                    "results": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/QueryResultItem"
                        }
                    }
                },
                "required": [
                    "results"
                ]
            },
            "QueryResultItem": {
                "type": "object",
                "properties": {
                    "key": {
                        "type": "string",
                        "maxLength": 256,
                        "minLength": 1
                    },
                    "value": {
                        "type": "string",
                        "maxLength": 5120,
                        "minLength": 0,
                        "format": "byte"
                    },
                    "vector": {
                        "type": "array",
                        "items": {
                            "type": "number",
                            "format": "float"
                        },
                        "maxItems": 4096,
                        "minItems": 0
                    },
                    "metadata": {
                        "$ref": "#/components/schemas/Metadata"
                    },
                    "distance": {
                        "type": "number",
                        "format": "float"
                    }
                },
                "required": [
                    "distance",
                    "key",
                    "metadata",
                    "value",
                    "vector"
                ]
            },
            "QueryType": {
                "oneOf": [
                    {
                        "type": "object",
                        "title": "key",
                        "properties": {
                            "key": {
                                "type": "string",
                                "maxLength": 256,
                                "minLength": 1
                            }
                        },
                        "required": [
                            "key"
                        ]
                    },
                    {
                        "type": "object",
                        "title": "vector",
                        "properties": {
                            "vector": {
                                "type": "array",
                                "items": {
                                    "type": "number",
                                    "format": "float"
                                },
                                "maxItems": 4096,
                                "minItems": 0
                            }
                        },
                        "required": [
                            "vector"
                        ]
                    }
                ]
            },
            "QuotaExceededExceptionResponseContent": {
                "type": "object",
                "properties": {
                    "message": {
                        "type": "string"
                    }
                },
                "required": [
                    "message"
                ]
            },
            "ServiceUnavailableErrorResponseContent": {
                "type": "object",
                "properties": {
                    "message": {
                        "type": "string"
                    }
                },
                "required": [
                    "message"
                ]
            },
            "SetItemRequestContent": {
                "type": "object",
                "properties": {
                    "value": {
                        "type": "string",
                        "maxLength": 5120,
                        "minLength": 0,
                        "format": "byte"
                    },
                    "vector": {
                        "type": "array",
                        "items": {
                            "type": "number",
                            "format": "float"
                        },
                        "maxItems": 4096,
                        "minItems": 0
                    },
                    "metadata": {
                        "$ref": "#/components/schemas/Metadata"
                    }
                },
                "required": [
                    "metadata",
                    "value",
                    "vector"
                ]
            },
            "ThrottlingErrorResponseContent": {
                "type": "object",
                "properties": {
                    "message": {
                        "type": "string"
                    }
                },
                "required": [
                    "message"
                ]
            }
        },
        "securitySchemes": {
            "smithy.api.httpApiKeyAuth": {
                "type": "http",
                "description": "API key authentication via the 'Authorization' header",
                "name": "Authorization",
                "in": "header",
                "scheme": "ApiKey"
            }
        }
    },
    "security": [
        {
            "smithy.api.httpApiKeyAuth": []
        }
    ]
}
