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>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
model name
"thenlper/gte-large"
text or multimodal content to embed. Each item is either a string, or a list of content parts ({"type":"text"} / {"type":"image_url"}) for multimodal embedding models such as nvidia/llama-nemotron-embed-vl-1b-v2.
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 If true, the request is rejected immediately with HTTP 429 when the model has no spare capacity, instead of waiting in the queue. Opt-in; the default (false) keeps standard queueing behavior.
Role hint for asymmetric retrieval models: 'query' embeds a search query, 'passage'/'document' embeds a document. Controls the query:/passage: prefix on VL embedding models; ignored by symmetric models.
query, passage, document format used when encoding
float, base64 The number of dimensions in the embedding. If not provided, the model's default will be used.If provided bigger than model's default, the embedding will be padded with zeros.
x >= 321536
Response
Successful Response