Create embeddings
curl --request POST \
--url https://kymaapi.com/v1/embeddings \
--header 'Authorization: Bearer <token>'import requests
url = "https://kymaapi.com/v1/embeddings"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://kymaapi.com/v1/embeddings', 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://kymaapi.com/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_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://kymaapi.com/v1/embeddings"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://kymaapi.com/v1/embeddings")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://kymaapi.com/v1/embeddings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyEndpoints
Create embeddings
Turn text into vectors for retrieval. OpenAI-compatible.
POST
/
v1
/
embeddings
Create embeddings
curl --request POST \
--url https://kymaapi.com/v1/embeddings \
--header 'Authorization: Bearer <token>'import requests
url = "https://kymaapi.com/v1/embeddings"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://kymaapi.com/v1/embeddings', 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://kymaapi.com/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_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://kymaapi.com/v1/embeddings"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://kymaapi.com/v1/embeddings")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://kymaapi.com/v1/embeddings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodySwitching from OpenAI
Change the base URL and the model id. Nothing else.from openai import OpenAI
client = OpenAI(
api_key="kyma-...",
base_url="https://api.kymaapi.com/v1",
)
vectors = client.embeddings.create(
model="embeddinggemma-300m",
input=["first document", "second document"],
)
Which model
| Model | Input / 1M | Dimensions | Input limit |
|---|---|---|---|
embeddinggemma-300m | $0.0027 | 768 | 2,048 tokens |
qwen3-embedding-8b | $0.0135 | 4096 | 32,768 tokens |
GET /v1/models?type=embedding lists all of them with prices and input limits.
Start with embeddinggemma-300m. It is the cheaper of the two by 5×, and 768 dimensions is enough for most retrieval — smaller vectors are also cheaper to store and faster to search.
Reach for qwen3-embedding-8b when recall quality matters more than cost, when your corpus is multilingual, or when documents are long enough that a 2,048-token window would force you to chunk them.
Embedding and chat models are not interchangeable. Passing a chat model here returns
400 naming the mistake rather than a vector you cannot use.Billing
Input tokens only. A vector has no completion side, sousage carries prompt_tokens, total_tokens and cost. cost is the price of the call at the model’s rate, to 8 decimal places. Your balance moves in steps of 0.0001:eachchargeisroundedtothenearest0.0001 when it is recorded, so a call as small as the one below takes nothing from it.
"usage": { "prompt_tokens": 14, "total_tokens": 14, "cost": 0.00000004 }
Batching
Pass an array toinput and you get one vector per element, in the same order. One request with 100 documents costs the same as 100 requests with one document each and is considerably faster — batch as large as your payload allows, up to 25 MB.
Responses are not streamed: a vector arrives whole.