curl --request POST \
--url https://api.deepinfra.com/v1/embeddings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "thenlper/gte-large",
"input": [
"I like chocolate"
],
"fail_fast": false,
"encoding_format": "float",
"dimensions": 1536
}
'import requests
url = "https://api.deepinfra.com/v1/embeddings"
payload = {
"model": "thenlper/gte-large",
"input": ["I like chocolate"],
"fail_fast": False,
"encoding_format": "float",
"dimensions": 1536
}
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: 'thenlper/gte-large',
input: ['I like chocolate'],
fail_fast: false,
encoding_format: 'float',
dimensions: 1536
})
};
fetch('https://api.deepinfra.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://api.deepinfra.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_POSTFIELDS => json_encode([
'model' => 'thenlper/gte-large',
'input' => [
'I like chocolate'
],
'fail_fast' => false,
'encoding_format' => 'float',
'dimensions' => 1536
]),
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.deepinfra.com/v1/embeddings"
payload := strings.NewReader("{\n \"model\": \"thenlper/gte-large\",\n \"input\": [\n \"I like chocolate\"\n ],\n \"fail_fast\": false,\n \"encoding_format\": \"float\",\n \"dimensions\": 1536\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.deepinfra.com/v1/embeddings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"thenlper/gte-large\",\n \"input\": [\n \"I like chocolate\"\n ],\n \"fail_fast\": false,\n \"encoding_format\": \"float\",\n \"dimensions\": 1536\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deepinfra.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>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"thenlper/gte-large\",\n \"input\": [\n \"I like chocolate\"\n ],\n \"fail_fast\": false,\n \"encoding_format\": \"float\",\n \"dimensions\": 1536\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Openai Embeddings
curl --request POST \
--url https://api.deepinfra.com/v1/embeddings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "thenlper/gte-large",
"input": [
"I like chocolate"
],
"fail_fast": false,
"encoding_format": "float",
"dimensions": 1536
}
'import requests
url = "https://api.deepinfra.com/v1/embeddings"
payload = {
"model": "thenlper/gte-large",
"input": ["I like chocolate"],
"fail_fast": False,
"encoding_format": "float",
"dimensions": 1536
}
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: 'thenlper/gte-large',
input: ['I like chocolate'],
fail_fast: false,
encoding_format: 'float',
dimensions: 1536
})
};
fetch('https://api.deepinfra.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://api.deepinfra.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_POSTFIELDS => json_encode([
'model' => 'thenlper/gte-large',
'input' => [
'I like chocolate'
],
'fail_fast' => false,
'encoding_format' => 'float',
'dimensions' => 1536
]),
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.deepinfra.com/v1/embeddings"
payload := strings.NewReader("{\n \"model\": \"thenlper/gte-large\",\n \"input\": [\n \"I like chocolate\"\n ],\n \"fail_fast\": false,\n \"encoding_format\": \"float\",\n \"dimensions\": 1536\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.deepinfra.com/v1/embeddings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"thenlper/gte-large\",\n \"input\": [\n \"I like chocolate\"\n ],\n \"fail_fast\": false,\n \"encoding_format\": \"float\",\n \"dimensions\": 1536\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deepinfra.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>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"thenlper/gte-large\",\n \"input\": [\n \"I like chocolate\"\n ],\n \"fail_fast\": false,\n \"encoding_format\": \"float\",\n \"dimensions\": 1536\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}inference scope (about scopes).Authorizations
Headers
Body
text or multimodal content to embed; one embedding per item. Each item is either a string, or a list of content parts (text / image_url / input_audio / audio_url / video_url) embedded together in part order, for multimodal embedding models such as google/embeddinggemma-2.
1024["I like chocolate"]
The service tier used for processing the request. 'priority' processes the request with higher priority (premium rate); 'flex' processes it at lower priority for a discount, served only when spare capacity exists and may be retried/timed out under load. Both apply only to models that support the respective tier. For compatibility, 'auto' is treated as 'priority' and 'standard_only' as 'default'.
default, priority, flex Task the embedding is optimized for, on models trained with task prompts (e.g. google/embeddinggemma-2). Applied to items containing text; mutually exclusive with input_type.
search_query, document, question_answering, fact_checking, code_retrieval, classification, clustering, sentence_similarity Response
Successful Response