LLM Chat Completion
curl --request POST \
--url https://api.runflow.ai/api/v1/runtime/v1/chat \
--header 'Content-Type: application/json' \
--data '
{
"projectId": "<string>",
"model": "gpt-4",
"messages": [
{
"content": "<string>",
"tool_calls": [
{}
],
"tool_call_id": "<string>",
"name": "<string>"
}
],
"providerName": "OpenAI Production",
"legacy": true,
"instructions": "<string>",
"temperature": 0.7,
"maxTokens": 1000,
"topP": 0.9,
"frequencyPenalty": 0.3,
"presencePenalty": 0.2,
"stop": [
"END",
"STOP"
],
"seed": 12345,
"tools": [
{}
],
"responseFormat": {
"type": "json_object"
},
"thinking": {
"type": "enabled",
"budgetTokens": 5000
},
"serverTools": [
{
"type": "web_search_20250305"
}
]
}
'import requests
url = "https://api.runflow.ai/api/v1/runtime/v1/chat"
payload = {
"projectId": "<string>",
"model": "gpt-4",
"messages": [
{
"content": "<string>",
"tool_calls": [{}],
"tool_call_id": "<string>",
"name": "<string>"
}
],
"providerName": "OpenAI Production",
"legacy": True,
"instructions": "<string>",
"temperature": 0.7,
"maxTokens": 1000,
"topP": 0.9,
"frequencyPenalty": 0.3,
"presencePenalty": 0.2,
"stop": ["END", "STOP"],
"seed": 12345,
"tools": [{}],
"responseFormat": { "type": "json_object" },
"thinking": {
"type": "enabled",
"budgetTokens": 5000
},
"serverTools": [{ "type": "web_search_20250305" }]
}
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({
projectId: '<string>',
model: 'gpt-4',
messages: [
{
content: '<string>',
tool_calls: [{}],
tool_call_id: '<string>',
name: '<string>'
}
],
providerName: 'OpenAI Production',
legacy: true,
instructions: '<string>',
temperature: 0.7,
maxTokens: 1000,
topP: 0.9,
frequencyPenalty: 0.3,
presencePenalty: 0.2,
stop: ['END', 'STOP'],
seed: 12345,
tools: [{}],
responseFormat: {type: 'json_object'},
thinking: {type: 'enabled', budgetTokens: 5000},
serverTools: [{type: 'web_search_20250305'}]
})
};
fetch('https://api.runflow.ai/api/v1/runtime/v1/chat', 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/chat",
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([
'projectId' => '<string>',
'model' => 'gpt-4',
'messages' => [
[
'content' => '<string>',
'tool_calls' => [
[
]
],
'tool_call_id' => '<string>',
'name' => '<string>'
]
],
'providerName' => 'OpenAI Production',
'legacy' => true,
'instructions' => '<string>',
'temperature' => 0.7,
'maxTokens' => 1000,
'topP' => 0.9,
'frequencyPenalty' => 0.3,
'presencePenalty' => 0.2,
'stop' => [
'END',
'STOP'
],
'seed' => 12345,
'tools' => [
[
]
],
'responseFormat' => [
'type' => 'json_object'
],
'thinking' => [
'type' => 'enabled',
'budgetTokens' => 5000
],
'serverTools' => [
[
'type' => 'web_search_20250305'
]
]
]),
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/chat"
payload := strings.NewReader("{\n \"projectId\": \"<string>\",\n \"model\": \"gpt-4\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_calls\": [\n {}\n ],\n \"tool_call_id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"providerName\": \"OpenAI Production\",\n \"legacy\": true,\n \"instructions\": \"<string>\",\n \"temperature\": 0.7,\n \"maxTokens\": 1000,\n \"topP\": 0.9,\n \"frequencyPenalty\": 0.3,\n \"presencePenalty\": 0.2,\n \"stop\": [\n \"END\",\n \"STOP\"\n ],\n \"seed\": 12345,\n \"tools\": [\n {}\n ],\n \"responseFormat\": {\n \"type\": \"json_object\"\n },\n \"thinking\": {\n \"type\": \"enabled\",\n \"budgetTokens\": 5000\n },\n \"serverTools\": [\n {\n \"type\": \"web_search_20250305\"\n }\n ]\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/chat")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"<string>\",\n \"model\": \"gpt-4\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_calls\": [\n {}\n ],\n \"tool_call_id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"providerName\": \"OpenAI Production\",\n \"legacy\": true,\n \"instructions\": \"<string>\",\n \"temperature\": 0.7,\n \"maxTokens\": 1000,\n \"topP\": 0.9,\n \"frequencyPenalty\": 0.3,\n \"presencePenalty\": 0.2,\n \"stop\": [\n \"END\",\n \"STOP\"\n ],\n \"seed\": 12345,\n \"tools\": [\n {}\n ],\n \"responseFormat\": {\n \"type\": \"json_object\"\n },\n \"thinking\": {\n \"type\": \"enabled\",\n \"budgetTokens\": 5000\n },\n \"serverTools\": [\n {\n \"type\": \"web_search_20250305\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runflow.ai/api/v1/runtime/v1/chat")
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 \"projectId\": \"<string>\",\n \"model\": \"gpt-4\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_calls\": [\n {}\n ],\n \"tool_call_id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"providerName\": \"OpenAI Production\",\n \"legacy\": true,\n \"instructions\": \"<string>\",\n \"temperature\": 0.7,\n \"maxTokens\": 1000,\n \"topP\": 0.9,\n \"frequencyPenalty\": 0.3,\n \"presencePenalty\": 0.2,\n \"stop\": [\n \"END\",\n \"STOP\"\n ],\n \"seed\": 12345,\n \"tools\": [\n {}\n ],\n \"responseFormat\": {\n \"type\": \"json_object\"\n },\n \"thinking\": {\n \"type\": \"enabled\",\n \"budgetTokens\": 5000\n },\n \"serverTools\": [\n {\n \"type\": \"web_search_20250305\"\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyRuntime API - Core
LLM Chat Completion
POST
/
api
/
v1
/
runtime
/
v1
/
chat
LLM Chat Completion
curl --request POST \
--url https://api.runflow.ai/api/v1/runtime/v1/chat \
--header 'Content-Type: application/json' \
--data '
{
"projectId": "<string>",
"model": "gpt-4",
"messages": [
{
"content": "<string>",
"tool_calls": [
{}
],
"tool_call_id": "<string>",
"name": "<string>"
}
],
"providerName": "OpenAI Production",
"legacy": true,
"instructions": "<string>",
"temperature": 0.7,
"maxTokens": 1000,
"topP": 0.9,
"frequencyPenalty": 0.3,
"presencePenalty": 0.2,
"stop": [
"END",
"STOP"
],
"seed": 12345,
"tools": [
{}
],
"responseFormat": {
"type": "json_object"
},
"thinking": {
"type": "enabled",
"budgetTokens": 5000
},
"serverTools": [
{
"type": "web_search_20250305"
}
]
}
'import requests
url = "https://api.runflow.ai/api/v1/runtime/v1/chat"
payload = {
"projectId": "<string>",
"model": "gpt-4",
"messages": [
{
"content": "<string>",
"tool_calls": [{}],
"tool_call_id": "<string>",
"name": "<string>"
}
],
"providerName": "OpenAI Production",
"legacy": True,
"instructions": "<string>",
"temperature": 0.7,
"maxTokens": 1000,
"topP": 0.9,
"frequencyPenalty": 0.3,
"presencePenalty": 0.2,
"stop": ["END", "STOP"],
"seed": 12345,
"tools": [{}],
"responseFormat": { "type": "json_object" },
"thinking": {
"type": "enabled",
"budgetTokens": 5000
},
"serverTools": [{ "type": "web_search_20250305" }]
}
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({
projectId: '<string>',
model: 'gpt-4',
messages: [
{
content: '<string>',
tool_calls: [{}],
tool_call_id: '<string>',
name: '<string>'
}
],
providerName: 'OpenAI Production',
legacy: true,
instructions: '<string>',
temperature: 0.7,
maxTokens: 1000,
topP: 0.9,
frequencyPenalty: 0.3,
presencePenalty: 0.2,
stop: ['END', 'STOP'],
seed: 12345,
tools: [{}],
responseFormat: {type: 'json_object'},
thinking: {type: 'enabled', budgetTokens: 5000},
serverTools: [{type: 'web_search_20250305'}]
})
};
fetch('https://api.runflow.ai/api/v1/runtime/v1/chat', 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/chat",
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([
'projectId' => '<string>',
'model' => 'gpt-4',
'messages' => [
[
'content' => '<string>',
'tool_calls' => [
[
]
],
'tool_call_id' => '<string>',
'name' => '<string>'
]
],
'providerName' => 'OpenAI Production',
'legacy' => true,
'instructions' => '<string>',
'temperature' => 0.7,
'maxTokens' => 1000,
'topP' => 0.9,
'frequencyPenalty' => 0.3,
'presencePenalty' => 0.2,
'stop' => [
'END',
'STOP'
],
'seed' => 12345,
'tools' => [
[
]
],
'responseFormat' => [
'type' => 'json_object'
],
'thinking' => [
'type' => 'enabled',
'budgetTokens' => 5000
],
'serverTools' => [
[
'type' => 'web_search_20250305'
]
]
]),
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/chat"
payload := strings.NewReader("{\n \"projectId\": \"<string>\",\n \"model\": \"gpt-4\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_calls\": [\n {}\n ],\n \"tool_call_id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"providerName\": \"OpenAI Production\",\n \"legacy\": true,\n \"instructions\": \"<string>\",\n \"temperature\": 0.7,\n \"maxTokens\": 1000,\n \"topP\": 0.9,\n \"frequencyPenalty\": 0.3,\n \"presencePenalty\": 0.2,\n \"stop\": [\n \"END\",\n \"STOP\"\n ],\n \"seed\": 12345,\n \"tools\": [\n {}\n ],\n \"responseFormat\": {\n \"type\": \"json_object\"\n },\n \"thinking\": {\n \"type\": \"enabled\",\n \"budgetTokens\": 5000\n },\n \"serverTools\": [\n {\n \"type\": \"web_search_20250305\"\n }\n ]\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/chat")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"<string>\",\n \"model\": \"gpt-4\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_calls\": [\n {}\n ],\n \"tool_call_id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"providerName\": \"OpenAI Production\",\n \"legacy\": true,\n \"instructions\": \"<string>\",\n \"temperature\": 0.7,\n \"maxTokens\": 1000,\n \"topP\": 0.9,\n \"frequencyPenalty\": 0.3,\n \"presencePenalty\": 0.2,\n \"stop\": [\n \"END\",\n \"STOP\"\n ],\n \"seed\": 12345,\n \"tools\": [\n {}\n ],\n \"responseFormat\": {\n \"type\": \"json_object\"\n },\n \"thinking\": {\n \"type\": \"enabled\",\n \"budgetTokens\": 5000\n },\n \"serverTools\": [\n {\n \"type\": \"web_search_20250305\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runflow.ai/api/v1/runtime/v1/chat")
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 \"projectId\": \"<string>\",\n \"model\": \"gpt-4\",\n \"messages\": [\n {\n \"content\": \"<string>\",\n \"tool_calls\": [\n {}\n ],\n \"tool_call_id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"providerName\": \"OpenAI Production\",\n \"legacy\": true,\n \"instructions\": \"<string>\",\n \"temperature\": 0.7,\n \"maxTokens\": 1000,\n \"topP\": 0.9,\n \"frequencyPenalty\": 0.3,\n \"presencePenalty\": 0.2,\n \"stop\": [\n \"END\",\n \"STOP\"\n ],\n \"seed\": 12345,\n \"tools\": [\n {}\n ],\n \"responseFormat\": {\n \"type\": \"json_object\"\n },\n \"thinking\": {\n \"type\": \"enabled\",\n \"budgetTokens\": 5000\n },\n \"serverTools\": [\n {\n \"type\": \"web_search_20250305\"\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyBody
application/json
Project ID
LLM provider
Available options:
openai, anthropic, bedrock, groq, gemini, xai, custom Model name
Example:
"gpt-4"
Messages
Show child attributes
Show child attributes
Provider name (configured in LLM Providers)
Example:
"OpenAI Production"
Use legacy Chat Completions API when true
Example:
true
System instructions
Temperature
Required range:
0 <= x <= 2Example:
0.7
Max tokens
Example:
1000
Top P (nucleus sampling)
Required range:
0 <= x <= 1Example:
0.9
Frequency penalty
Required range:
-2 <= x <= 2Example:
0.3
Presence penalty
Required range:
-2 <= x <= 2Example:
0.2
Stop sequences
Example:
["END", "STOP"]Seed for reproducible outputs
Example:
12345
Tools available for the model to call
Response format for structured output
Example:
{ "type": "json_object" }Enable extended thinking/reasoning for supported models
Example:
{ "type": "enabled", "budgetTokens": 5000 }Server-side tools (provider-specific). Anthropic: web_search, code_execution
Example:
[{ "type": "web_search_20250305" }]Response
ChatResponse: { text, finishReason, usage: { promptTokens, completionTokens, totalTokens }, model, toolCalls? }.
⌘I