🧬 Embedding Documents
Add Documents (bulk)
This endpoint generates and stores a Document(embedding) with the inputted data in bulk.
POST
/
v1
/
index
/
bulk
Header
Body
curl --location --request POST 'https://api.getmetal.io/v1/index/bulk' \
--header 'Content-Type: application/json' \
--header 'x-metal-api-key: <api-key>' \
--header 'x-metal-client-id: <client-id>' \
--data-raw '{
"data": [
{
"index": "index-id",
"text": "Ozzy is the best vocalist of all time",
"id": "my-unique-id1",
"metadata": {
"band": "Black Sabbath",
"year": 1970
}
},
{
"index": "index-id",
"text": "Dave Mustain disagrees",
"id": "my-unique-id2",
"metadata": {
"band": "Megadeth",
"year": 1983
}
}
]
}'
{
"data": {
"ids": [
"my-unique-id1",
"my-unique-id2"
]
}
}
Auth Headers
x-metal-api-key
string
requiredAn API key for your org.
x-metal-client-id
string
requiredA Client ID for your org.
Body
data
array
requireddata
Data Object
index
string
requiredIndex ID
id
string
Identifier for your embedding. Must be between 3 - 256 chars and consist of
numbers, letters, or -
. If not provided, a random ID will be generated.
text
string
Text to be embedded. Must be between 3 - 10,000 chars.
imageUrl
string
Image URL
embedding
number[]
Custom Embeddings
metadata
object
Additional metadata for the document.
curl --location --request POST 'https://api.getmetal.io/v1/index/bulk' \
--header 'Content-Type: application/json' \
--header 'x-metal-api-key: <api-key>' \
--header 'x-metal-client-id: <client-id>' \
--data-raw '{
"data": [
{
"index": "index-id",
"text": "Ozzy is the best vocalist of all time",
"id": "my-unique-id1",
"metadata": {
"band": "Black Sabbath",
"year": 1970
}
},
{
"index": "index-id",
"text": "Dave Mustain disagrees",
"id": "my-unique-id2",
"metadata": {
"band": "Megadeth",
"year": 1983
}
}
]
}'
{
"data": {
"ids": [
"my-unique-id1",
"my-unique-id2"
]
}
}