Create embeddings
curl --request POST \
--url https://ai.eu.corti.app/v1/embeddings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "corti-s1",
"input": "Hello world"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: 'corti-s1', input: 'Hello world'})
};
fetch('https://ai.eu.corti.app/v1/embeddings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));using RestSharp;
var options = new RestClientOptions("https://ai.eu.corti.app/v1/embeddings");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"model\": \"corti-s1\",\n \"input\": \"Hello world\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);import requests
url = "https://ai.eu.corti.app/v1/embeddings"
payload = {
"model": "corti-s1",
"input": "Hello world"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ai.eu.corti.app/v1/embeddings",
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' => 'corti-s1',
'input' => 'Hello world'
]),
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://ai.eu.corti.app/v1/embeddings"
payload := strings.NewReader("{\n \"model\": \"corti-s1\",\n \"input\": \"Hello world\"\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://ai.eu.corti.app/v1/embeddings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"corti-s1\",\n \"input\": \"Hello world\"\n}")
.asString();{
"object": "list",
"model": "<string>",
"data": [
{
"object": "embedding",
"index": 123,
"embedding": [
123
]
}
],
"usage": {
"prompt_tokens": 123,
"total_tokens": 123
}
}{
"error": "<string>",
"detail": "<string>"
}Embeddings
Create embeddings
Creates embeddings for the given input text.
POST
/
embeddings
Create embeddings
curl --request POST \
--url https://ai.eu.corti.app/v1/embeddings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "corti-s1",
"input": "Hello world"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: 'corti-s1', input: 'Hello world'})
};
fetch('https://ai.eu.corti.app/v1/embeddings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));using RestSharp;
var options = new RestClientOptions("https://ai.eu.corti.app/v1/embeddings");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"model\": \"corti-s1\",\n \"input\": \"Hello world\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);import requests
url = "https://ai.eu.corti.app/v1/embeddings"
payload = {
"model": "corti-s1",
"input": "Hello world"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ai.eu.corti.app/v1/embeddings",
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' => 'corti-s1',
'input' => 'Hello world'
]),
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://ai.eu.corti.app/v1/embeddings"
payload := strings.NewReader("{\n \"model\": \"corti-s1\",\n \"input\": \"Hello world\"\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://ai.eu.corti.app/v1/embeddings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"corti-s1\",\n \"input\": \"Hello world\"\n}")
.asString();{
"object": "list",
"model": "<string>",
"data": [
{
"object": "embedding",
"index": 123,
"embedding": [
123
]
}
],
"usage": {
"prompt_tokens": 123,
"total_tokens": 123
}
}{
"error": "<string>",
"detail": "<string>"
}Authorizations
Use a Corti-issued bearer token.
Body
application/json
Was this page helpful?
⌘I