POST
/
v1
/
indexes
curl --location --request POST 'https://api.getmetal.io/v1/indexes' \
--header 'Content-Type: application/json' \
--header 'x-metal-api-key: <api-key>' \
--header 'x-metal-client-id: <client-id>' \
--data-raw '{
    "model": "text-embedding-ada-002",
    "name": "Ozzy Osbourne",
    "filters": [
      {
        "field": "name",
        "type": "string"
      },
      {
        "field": "age",
        "type": "number"
      }
    ]
}'
{
	"data": {
		"id": "1",
		"createdAt": "2023-08-23T22:13:31.539Z",
		"status": "LIVE",
		"name": "Ozzy Osbourne",
		"model": "text-embedding-ada-002",
		"dimensions": 1536,
		"filters": [
			{
				"field": "name",
				"type": "string"
			},
			{
				"field": "age",
				"type": "number"
			}
		],
    "chunkConfig": {
      "size": 500,
      "overlap": 20
    },
    "tableChunkConfig": {
      "size": 4000
    },
		"counts": {
			"docs": 0,
		}
	}
}

Auth Headers

x-metal-api-key
string
required

An API key for your org.

x-metal-client-id
string
required

A Client ID for your org.

Body

model
string
required

The Embedding Model to use. Can be either β€œtext-embedding-ada-002”, β€œclip”, or β€œcustom”.

name
string
required

Name of the Index

datasource
string

Datasource ID to connect to the index.

indexType
string
default: "HNSW"

Type of the index. FLAT or HNSW

dimensions
integer

This is only required if you are using a β€œcustom” model.

filters
object[]
chunkConfig
object
tableChunkConfig
object

Response

data
Index Object
curl --location --request POST 'https://api.getmetal.io/v1/indexes' \
--header 'Content-Type: application/json' \
--header 'x-metal-api-key: <api-key>' \
--header 'x-metal-client-id: <client-id>' \
--data-raw '{
    "model": "text-embedding-ada-002",
    "name": "Ozzy Osbourne",
    "filters": [
      {
        "field": "name",
        "type": "string"
      },
      {
        "field": "age",
        "type": "number"
      }
    ]
}'
{
	"data": {
		"id": "1",
		"createdAt": "2023-08-23T22:13:31.539Z",
		"status": "LIVE",
		"name": "Ozzy Osbourne",
		"model": "text-embedding-ada-002",
		"dimensions": 1536,
		"filters": [
			{
				"field": "name",
				"type": "string"
			},
			{
				"field": "age",
				"type": "number"
			}
		],
    "chunkConfig": {
      "size": 500,
      "overlap": 20
    },
    "tableChunkConfig": {
      "size": 4000
    },
		"counts": {
			"docs": 0,
		}
	}
}