Embeddings
POSThttps://api.withemissary.com/v1/embeddings
Get embeddings from a deployment using the provided input.
Request
Responses
- 200
- 400
- 404
Successful operation
Invalid Input error
Not Found error
Authorization: X-API-Key
name: X-API-Keytype: apiKeyin: header
- python
- curl
- go
- nodejs
- ruby
- java
- powershell
- HTTP.CLIENT
- REQUESTS
import http.client
import json
conn = http.client.HTTPSConnection("api.withemissary.com")
payload = json.dumps({
"model": "Llama-3.2-1B-Instruct",
"input": "What is the capital of France?",
"target": "Paris is the capital of France.",
"cosine": True,
"manhattan": False,
"euclidean": False
})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'X-API-Key': '<API_KEY_VALUE>'
}
conn.request("POST", "/v1/embeddings", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))