Embeddings
POST
/v1/embeddingsPOST
/v1/embeddingsYour instance endpoint, shown on the instance page in the dashboard. Each instance has its own host; there is no shared API host.
Request Body
| Property | Type | Required | Description |
|---|---|---|---|
model | string | No | |
input | string | No | |
metadata | object | No | |
messages | object[] | No |
Responses
200 The embeddings
| Property | Type | Description |
|---|---|---|
result | object | |
error | object |
default An unexpected error response.
| Property | Type | Description |
|---|---|---|
code | integer | |
message | string | |
details | object[] |
Request
curl -X POST "http://localhost:8089/openai/v1/embeddings" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"string","input":"string","messages":[{"role":"ROLE_UNSPECIFIED","content":[],"toolCalls":[],"toolCallId":"string","name":"string"}]}'const response = await fetch("http://localhost:8089/openai/v1/embeddings", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "string",
"input": "string",
"messages": [
{
"role": "ROLE_UNSPECIFIED",
"content": [],
"toolCalls": [],
"toolCallId": "string",
"name": "string"
}
]
}),
});
const data = await response.json();import requests
response = requests.post(
"http://localhost:8089/openai/v1/embeddings",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"model": "string",
"input": "string",
"messages": [
{
"role": "ROLE_UNSPECIFIED",
"content": [],
"toolCalls": [],
"toolCallId": "string",
"name": "string"
}
]
},
)
data = response.json()Response
{
"result": {
"object": "string",
"data": [
{
"object": "string",
"embedding": [],
"index": 0
}
],
"model": "string",
"id": "string",
"usage": {
"promptTokens": 0,
"totalTokens": 0,
"cost": 0
}
},
"error": {
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
}{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
