Create a new embeddings
curl --request POST \
--url https://api.pawa-ai.com/v1/vectors/embedding \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "pawa-embeddings-v1-20241001",
"sentences": [
"Hello world",
"How are you?"
],
"lang": "multi"
}
'import requests
url = "https://api.pawa-ai.com/v1/vectors/embedding"
payload = {
"model": "pawa-embeddings-v1-20241001",
"sentences": ["Hello world", "How are you?"],
"lang": "multi"
}
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: 'pawa-embeddings-v1-20241001',
sentences: ['Hello world', 'How are you?'],
lang: 'multi'
})
};
fetch('https://api.pawa-ai.com/v1/vectors/embedding', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pawa-ai.com/v1/vectors/embedding",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'pawa-embeddings-v1-20241001',
'sentences' => [
'Hello world',
'How are you?'
],
'lang' => 'multi'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pawa-ai.com/v1/vectors/embedding"
payload := strings.NewReader("{\n \"model\": \"pawa-embeddings-v1-20241001\",\n \"sentences\": [\n \"Hello world\",\n \"How are you?\"\n ],\n \"lang\": \"multi\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.pawa-ai.com/v1/vectors/embedding")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"pawa-embeddings-v1-20241001\",\n \"sentences\": [\n \"Hello world\",\n \"How are you?\"\n ],\n \"lang\": \"multi\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pawa-ai.com/v1/vectors/embedding")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"pawa-embeddings-v1-20241001\",\n \"sentences\": [\n \"Hello world\",\n \"How are you?\"\n ],\n \"lang\": \"multi\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Embeddings created successfully",
"data": {
"embeddings": [
[
0.0047908169,
-0.0000800654,
-0.0000212658,
0.0144227119,
0.0173993539,
-0.0002167973
],
[
0.0047908169,
-0.0000800654,
-0.0000212658,
0.0144227119,
0.0173993539,
-0.0002167973
]
]
}
}{
"success": false,
"message": "Invalid input provided"
}{
"success": false,
"message": "Unauthorized access"
}{
"success": false,
"message": "You do not have permission to access this resource"
}{
"success": false,
"message": "Resource does not exist"
}{
"success": false,
"message": "Rate limit exceeded. Please try again later."
}{
"success": false,
"message": "Internal server error"
}Vectors
Create Embeddings
This endpoint used to create new custom embeddings for the given input text using the specified model.
POST
/
vectors
/
embedding
Create a new embeddings
curl --request POST \
--url https://api.pawa-ai.com/v1/vectors/embedding \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "pawa-embeddings-v1-20241001",
"sentences": [
"Hello world",
"How are you?"
],
"lang": "multi"
}
'import requests
url = "https://api.pawa-ai.com/v1/vectors/embedding"
payload = {
"model": "pawa-embeddings-v1-20241001",
"sentences": ["Hello world", "How are you?"],
"lang": "multi"
}
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: 'pawa-embeddings-v1-20241001',
sentences: ['Hello world', 'How are you?'],
lang: 'multi'
})
};
fetch('https://api.pawa-ai.com/v1/vectors/embedding', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pawa-ai.com/v1/vectors/embedding",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'pawa-embeddings-v1-20241001',
'sentences' => [
'Hello world',
'How are you?'
],
'lang' => 'multi'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pawa-ai.com/v1/vectors/embedding"
payload := strings.NewReader("{\n \"model\": \"pawa-embeddings-v1-20241001\",\n \"sentences\": [\n \"Hello world\",\n \"How are you?\"\n ],\n \"lang\": \"multi\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.pawa-ai.com/v1/vectors/embedding")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"pawa-embeddings-v1-20241001\",\n \"sentences\": [\n \"Hello world\",\n \"How are you?\"\n ],\n \"lang\": \"multi\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pawa-ai.com/v1/vectors/embedding")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"pawa-embeddings-v1-20241001\",\n \"sentences\": [\n \"Hello world\",\n \"How are you?\"\n ],\n \"lang\": \"multi\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Embeddings created successfully",
"data": {
"embeddings": [
[
0.0047908169,
-0.0000800654,
-0.0000212658,
0.0144227119,
0.0173993539,
-0.0002167973
],
[
0.0047908169,
-0.0000800654,
-0.0000212658,
0.0144227119,
0.0173993539,
-0.0002167973
]
]
}
}{
"success": false,
"message": "Invalid input provided"
}{
"success": false,
"message": "Unauthorized access"
}{
"success": false,
"message": "You do not have permission to access this resource"
}{
"success": false,
"message": "Resource does not exist"
}{
"success": false,
"message": "Rate limit exceeded. Please try again later."
}{
"success": false,
"message": "Internal server error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The model for the embedding request
Available options:
pawa-embeddings-v1-20241001 Example:
"pawa-embeddings-v1-20241001"
A list of sentences to embed
Example:
["Hello world", "How are you?"]
The model for the embedding request
⌘I