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));엔드포인트
임베딩
OpenAI Embeddings 형식. text-embedding-3-small은 1536차원 벡터를 반환합니다.
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));플레이그라운드에 토큰을 넣으면 실제 요청을 보낼 수 있습니다. 일반 호출과 똑같이 과금됩니다.
인증
Token from https://api.xhuoapi.ai
응답
Embedding vectors