Embeddings
curl --request POST \
--url https://api.euron.one/api/v1/euri/embeddings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": {},
"dimensions": 123,
"encoding_format": "<string>",
"user": "<string>"
}
'import requests
url = "https://api.euron.one/api/v1/euri/embeddings"
payload = {
"model": "<string>",
"input": {},
"dimensions": 123,
"encoding_format": "<string>",
"user": "<string>"
}
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: '<string>',
input: {},
dimensions: 123,
encoding_format: '<string>',
user: '<string>'
})
};
fetch('https://api.euron.one/api/v1/euri/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://api.euron.one/api/v1/euri/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' => '<string>',
'input' => [
],
'dimensions' => 123,
'encoding_format' => '<string>',
'user' => '<string>'
]),
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.euron.one/api/v1/euri/embeddings"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"input\": {},\n \"dimensions\": 123,\n \"encoding_format\": \"<string>\",\n \"user\": \"<string>\"\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.euron.one/api/v1/euri/embeddings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"input\": {},\n \"dimensions\": 123,\n \"encoding_format\": \"<string>\",\n \"user\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.euron.one/api/v1/euri/embeddings")
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\": \"<string>\",\n \"input\": {},\n \"dimensions\": 123,\n \"encoding_format\": \"<string>\",\n \"user\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyAPI Reference
Embeddings
Create vector embeddings for text input. Use for search, clustering, and RAG applications.
POST
/
embeddings
Embeddings
curl --request POST \
--url https://api.euron.one/api/v1/euri/embeddings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": {},
"dimensions": 123,
"encoding_format": "<string>",
"user": "<string>"
}
'import requests
url = "https://api.euron.one/api/v1/euri/embeddings"
payload = {
"model": "<string>",
"input": {},
"dimensions": 123,
"encoding_format": "<string>",
"user": "<string>"
}
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: '<string>',
input: {},
dimensions: 123,
encoding_format: '<string>',
user: '<string>'
})
};
fetch('https://api.euron.one/api/v1/euri/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://api.euron.one/api/v1/euri/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' => '<string>',
'input' => [
],
'dimensions' => 123,
'encoding_format' => '<string>',
'user' => '<string>'
]),
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.euron.one/api/v1/euri/embeddings"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"input\": {},\n \"dimensions\": 123,\n \"encoding_format\": \"<string>\",\n \"user\": \"<string>\"\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.euron.one/api/v1/euri/embeddings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"input\": {},\n \"dimensions\": 123,\n \"encoding_format\": \"<string>\",\n \"user\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.euron.one/api/v1/euri/embeddings")
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\": \"<string>\",\n \"input\": {},\n \"dimensions\": 123,\n \"encoding_format\": \"<string>\",\n \"user\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyRequest
POST https://api.euron.one/api/v1/euri/embeddings
Body parameters
string
required
Embedding model ID. Options:
text-embedding-3-small, togethercomputer/m2-bert-80M-32k-retrieval, gemini-embedding-001, gemini-embedding-2-preview.string | array
required
Text to embed. Can be a single string or an array of strings.
integer
Number of dimensions for the output vector. Supported by models trained with Matryoshka Representation Learning (MRL):
text-embedding-3-small (up to 1536), gemini-embedding-001 and gemini-embedding-2-preview (128–3072, recommended: 768, 1536, 3072). If omitted, the model’s default is used.string
Format of the embedding. Options:
"float" (default), "base64".string
A unique identifier for the end-user, used for abuse monitoring.
Examples
curl -X POST https://api.euron.one/api/v1/euri/embeddings \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_EURI_API_KEY" \
-d '{
"model": "text-embedding-3-small",
"input": "The quick brown fox jumps over the lazy dog."
}'
from openai import OpenAI
client = OpenAI(
api_key="YOUR_EURI_API_KEY",
base_url="https://api.euron.one/api/v1/euri"
)
response = client.embeddings.create(
model="text-embedding-3-small",
input="The quick brown fox jumps over the lazy dog."
)
print(response.data[0].embedding[:5]) # First 5 dimensions
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'YOUR_EURI_API_KEY',
baseURL: 'https://api.euron.one/api/v1/euri',
});
const response = await client.embeddings.create({
model: 'text-embedding-3-small',
input: 'The quick brown fox jumps over the lazy dog.',
});
console.log(response.data[0].embedding.slice(0, 5));
Gemini Embedding 2 with custom dimensions
gemini-embedding-2-preview is a premium model. It requires wallet balance. It is Google’s first multimodal embedding model with 8K token input and 3072-dimensional vectors with Matryoshka support.curl -X POST https://api.euron.one/api/v1/euri/embeddings \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_EURI_API_KEY" \
-d '{
"model": "gemini-embedding-2-preview",
"input": "Semantic search with multimodal embeddings",
"dimensions": 768
}'
from openai import OpenAI
client = OpenAI(
api_key="YOUR_EURI_API_KEY",
base_url="https://api.euron.one/api/v1/euri"
)
response = client.embeddings.create(
model="gemini-embedding-2-preview",
input="Semantic search with multimodal embeddings",
dimensions=768
)
print(f"Dimensions: {len(response.data[0].embedding)}") # 768
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: 'YOUR_EURI_API_KEY',
baseURL: 'https://api.euron.one/api/v1/euri',
});
const response = await client.embeddings.create({
model: 'gemini-embedding-2-preview',
input: 'Semantic search with multimodal embeddings',
dimensions: 768,
});
console.log(`Dimensions: ${response.data[0].embedding.length}`); // 768
Batch embeddings
curl -X POST https://api.euron.one/api/v1/euri/embeddings \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_EURI_API_KEY" \
-d '{
"model": "gemini-embedding-2-preview",
"input": [
"First document text",
"Second document text",
"Third document text"
],
"dimensions": 1536
}'
Model comparison
| Model | Provider | Premium | Max input | Default dims | Custom dims | Price ($/M tokens) |
|---|---|---|---|---|---|---|
text-embedding-3-small | OpenAI | No | 8,191 | 1,536 | Up to 1,536 | $0.02 |
togethercomputer/m2-bert-80M-32k-retrieval | Together | No | 32,768 | 768 | Fixed (768) | $0.008 |
gemini-embedding-001 | No | 2,048 | 3,072 | 128–3,072 | $0.15 | |
gemini-embedding-2-preview | Yes | 8,192 | 3,072 | 128–3,072 | $0.20 |
For
gemini-embedding-001 and gemini-embedding-2-preview, the default 3072-dimensional output is already normalized. For smaller dimensions (768, 1536), normalize the output vectors yourself (L2 norm) for best cosine similarity results.Response
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [0.0023064255, -0.009327292, 0.015797347, ...]
}
],
"model": "gemini-embedding-2-preview",
"usage": {
"prompt_tokens": 10,
"total_tokens": 10
}
}