Embeddings
curl --request POST \
--url https://api.xhuoapi.ai/v1/embeddings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "text-embedding-3-small",
"input": "Hello"
}
'import requests
url = "https://api.xhuoapi.ai/v1/embeddings"
payload = {
"model": "text-embedding-3-small",
"input": "Hello"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: 'text-embedding-3-small', input: 'Hello'})
};
fetch('https://api.xhuoapi.ai/v1/embeddings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Endpoints
Embeddings
OpenAI Embeddings format. text-embedding-3-small returns 1536-dimension vectors.
POST
/
embeddings
Embeddings
curl --request POST \
--url https://api.xhuoapi.ai/v1/embeddings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "text-embedding-3-small",
"input": "Hello"
}
'import requests
url = "https://api.xhuoapi.ai/v1/embeddings"
payload = {
"model": "text-embedding-3-small",
"input": "Hello"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: 'text-embedding-3-small', input: 'Hello'})
};
fetch('https://api.xhuoapi.ai/v1/embeddings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Fill in your token in the playground to send a real request. Requests are billed like any other call.