Embed texts
curl --request POST \
--url https://api.conare.ai/embed \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": [
"how do refunds work?"
],
"type": "query"
}
'import requests
url = "https://api.conare.ai/embed"
payload = {
"input": ["how do refunds work?"],
"type": "query"
}
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({input: ['how do refunds work?'], type: 'query'})
};
fetch('https://api.conare.ai/embed', 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.conare.ai/embed",
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([
'input' => [
'how do refunds work?'
],
'type' => 'query'
]),
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.conare.ai/embed"
payload := strings.NewReader("{\n \"input\": [\n \"how do refunds work?\"\n ],\n \"type\": \"query\"\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.conare.ai/embed")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": [\n \"how do refunds work?\"\n ],\n \"type\": \"query\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.conare.ai/embed")
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 \"input\": [\n \"how do refunds work?\"\n ],\n \"type\": \"query\"\n}"
response = http.request(request)
puts response.read_body{
"embeddings": [
[
123
]
],
"model": "<string>",
"dimensions": 123
}{
"error": {
"code": "invalid_request",
"message": "text is required",
"request_id": "req_8f3a2c"
}
}{
"error": {
"code": "invalid_request",
"message": "text is required",
"request_id": "req_8f3a2c"
}
}{
"error": {
"code": "invalid_request",
"message": "text is required",
"request_id": "req_8f3a2c"
}
}{
"error": {
"code": "invalid_request",
"message": "text is required",
"request_id": "req_8f3a2c"
}
}Models
Embed texts
Returns one vector per input. Use query for search queries and document for stored text.
POST
/
embed
Embed texts
curl --request POST \
--url https://api.conare.ai/embed \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": [
"how do refunds work?"
],
"type": "query"
}
'import requests
url = "https://api.conare.ai/embed"
payload = {
"input": ["how do refunds work?"],
"type": "query"
}
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({input: ['how do refunds work?'], type: 'query'})
};
fetch('https://api.conare.ai/embed', 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.conare.ai/embed",
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([
'input' => [
'how do refunds work?'
],
'type' => 'query'
]),
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.conare.ai/embed"
payload := strings.NewReader("{\n \"input\": [\n \"how do refunds work?\"\n ],\n \"type\": \"query\"\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.conare.ai/embed")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": [\n \"how do refunds work?\"\n ],\n \"type\": \"query\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.conare.ai/embed")
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 \"input\": [\n \"how do refunds work?\"\n ],\n \"type\": \"query\"\n}"
response = http.request(request)
puts response.read_body{
"embeddings": [
[
123
]
],
"model": "<string>",
"dimensions": 123
}{
"error": {
"code": "invalid_request",
"message": "text is required",
"request_id": "req_8f3a2c"
}
}{
"error": {
"code": "invalid_request",
"message": "text is required",
"request_id": "req_8f3a2c"
}
}{
"error": {
"code": "invalid_request",
"message": "text is required",
"request_id": "req_8f3a2c"
}
}{
"error": {
"code": "invalid_request",
"message": "text is required",
"request_id": "req_8f3a2c"
}
}Authorizations
An API key from conare.ai/console/keys. It can read and write every namespace in its organization.
Body
application/json