Generate embeddings
curl --request POST \
--url https://api.runflow.ai/api/v1/runtime/v1/embeddings \
--header 'Content-Type: application/json' \
--data '
{
"input": [
"Hello, world!",
"How are you?"
],
"model": "text-embedding-3-small",
"provider": "openai",
"providerName": "My OpenAI Production",
"dimensions": 1536
}
'import requests
url = "https://api.runflow.ai/api/v1/runtime/v1/embeddings"
payload = {
"input": ["Hello, world!", "How are you?"],
"model": "text-embedding-3-small",
"provider": "openai",
"providerName": "My OpenAI Production",
"dimensions": 1536
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
input: ['Hello, world!', 'How are you?'],
model: 'text-embedding-3-small',
provider: 'openai',
providerName: 'My OpenAI Production',
dimensions: 1536
})
};
fetch('https://api.runflow.ai/api/v1/runtime/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.runflow.ai/api/v1/runtime/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([
'input' => [
'Hello, world!',
'How are you?'
],
'model' => 'text-embedding-3-small',
'provider' => 'openai',
'providerName' => 'My OpenAI Production',
'dimensions' => 1536
]),
CURLOPT_HTTPHEADER => [
"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.runflow.ai/api/v1/runtime/v1/embeddings"
payload := strings.NewReader("{\n \"input\": [\n \"Hello, world!\",\n \"How are you?\"\n ],\n \"model\": \"text-embedding-3-small\",\n \"provider\": \"openai\",\n \"providerName\": \"My OpenAI Production\",\n \"dimensions\": 1536\n}")
req, _ := http.NewRequest("POST", url, payload)
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.runflow.ai/api/v1/runtime/v1/embeddings")
.header("Content-Type", "application/json")
.body("{\n \"input\": [\n \"Hello, world!\",\n \"How are you?\"\n ],\n \"model\": \"text-embedding-3-small\",\n \"provider\": \"openai\",\n \"providerName\": \"My OpenAI Production\",\n \"dimensions\": 1536\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runflow.ai/api/v1/runtime/v1/embeddings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": [\n \"Hello, world!\",\n \"How are you?\"\n ],\n \"model\": \"text-embedding-3-small\",\n \"provider\": \"openai\",\n \"providerName\": \"My OpenAI Production\",\n \"dimensions\": 1536\n}"
response = http.request(request)
puts response.read_bodyRuntime API - Embeddings
Generate embeddings
Generate embeddings for an array of texts.
Authentication:
- Requires
x-api-keyheader with valid API key or internal service key. - Requires
x-runflow-tenant-idheader for tenant identification.
Credential Resolution:
- Credentials are resolved automatically from tenant’s LLM Providers configuration.
- Use ‘providerName’ to specify which provider configuration to use.
Supported Providers:
openai: text-embedding-3-small, text-embedding-3-large, text-embedding-ada-002azure_openai: Azure OpenAI deploymentscohere: embed-english-v3.0, embed-multilingual-v3.0
Example Request:
{
"input": ["Hello, world!", "How are you?"],
"model": "text-embedding-3-small",
"dimensions": 1536
}
POST
/
api
/
v1
/
runtime
/
v1
/
embeddings
Generate embeddings
curl --request POST \
--url https://api.runflow.ai/api/v1/runtime/v1/embeddings \
--header 'Content-Type: application/json' \
--data '
{
"input": [
"Hello, world!",
"How are you?"
],
"model": "text-embedding-3-small",
"provider": "openai",
"providerName": "My OpenAI Production",
"dimensions": 1536
}
'import requests
url = "https://api.runflow.ai/api/v1/runtime/v1/embeddings"
payload = {
"input": ["Hello, world!", "How are you?"],
"model": "text-embedding-3-small",
"provider": "openai",
"providerName": "My OpenAI Production",
"dimensions": 1536
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
input: ['Hello, world!', 'How are you?'],
model: 'text-embedding-3-small',
provider: 'openai',
providerName: 'My OpenAI Production',
dimensions: 1536
})
};
fetch('https://api.runflow.ai/api/v1/runtime/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.runflow.ai/api/v1/runtime/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([
'input' => [
'Hello, world!',
'How are you?'
],
'model' => 'text-embedding-3-small',
'provider' => 'openai',
'providerName' => 'My OpenAI Production',
'dimensions' => 1536
]),
CURLOPT_HTTPHEADER => [
"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.runflow.ai/api/v1/runtime/v1/embeddings"
payload := strings.NewReader("{\n \"input\": [\n \"Hello, world!\",\n \"How are you?\"\n ],\n \"model\": \"text-embedding-3-small\",\n \"provider\": \"openai\",\n \"providerName\": \"My OpenAI Production\",\n \"dimensions\": 1536\n}")
req, _ := http.NewRequest("POST", url, payload)
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.runflow.ai/api/v1/runtime/v1/embeddings")
.header("Content-Type", "application/json")
.body("{\n \"input\": [\n \"Hello, world!\",\n \"How are you?\"\n ],\n \"model\": \"text-embedding-3-small\",\n \"provider\": \"openai\",\n \"providerName\": \"My OpenAI Production\",\n \"dimensions\": 1536\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runflow.ai/api/v1/runtime/v1/embeddings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": [\n \"Hello, world!\",\n \"How are you?\"\n ],\n \"model\": \"text-embedding-3-small\",\n \"provider\": \"openai\",\n \"providerName\": \"My OpenAI Production\",\n \"dimensions\": 1536\n}"
response = http.request(request)
puts response.read_bodyBody
application/json
Array of texts to generate embeddings for
Example:
["Hello, world!", "How are you?"]
Embeddings model
Example:
"text-embedding-3-small"
Embeddings provider
Available options:
openai, azure_openai, cohere Provider name (configured in LLM Providers) for credential resolution
Example:
"My OpenAI Production"
Embedding dimensions (only for models that support it)
Example:
1536
Response
Embeddings generated successfully