Skip to main content
Initialize an upload session for creating a new index. Returns a presigned URL where you upload the index’s documents, and a jobId to pass to startBuild once the upload completes. Required fields: indexName, modelId, docCount, dimension Example request
Responses

Upload body

PUT one binary body to uploadUrl. All integers are unsigned 32-bit little-endian. Each document is an object with a string id, a string text and an optional metadata object whose values are strings. IDs must be unique. Moss embeds the text. Use a built-in modelId with dimension 0, and send no vectors. The built index answers text queries in the current SDKs. You send the vectors. Use modelId custom with the length of your vectors as dimension, and append one vector per document. Query this index with your own query embedding, since Moss cannot embed a text query for vectors it did not make.
Then call startBuild with the jobId. Errors
  • 400 when a field is missing or invalid, when docCount is above 100,000, or when dimension is 0 with modelId custom.
  • 409 when an index with this name already exists. Delete it first, or choose another name.
  • 409 when a build is already running for this index name.
  • 403 MODEL_NOT_ALLOWED when the organization cannot use modelId.
  • 429 USAGE_LIMIT_EXCEEDED when the project is over its usage limit.