Skip to main content
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"
    }
  ]
}
'

Documentation Index

Fetch the complete documentation index at: https://docs.runflow.ai/llms.txt

Use this file to discover all available pages before exploring further.

Body

application/json
projectId
string
required

Project ID

provider
enum<string>
required

LLM provider

Available options:
openai,
anthropic,
bedrock,
groq,
gemini,
xai,
custom
model
string
required

Model name

Example:

"gpt-4"

messages
object[]
required

Messages

providerName
string

Provider name (configured in LLM Providers)

Example:

"OpenAI Production"

legacy
boolean

Use legacy Chat Completions API when true

Example:

true

instructions
string

System instructions

temperature
number

Temperature

Required range: 0 <= x <= 2
Example:

0.7

maxTokens
number

Max tokens

Example:

1000

topP
number

Top P (nucleus sampling)

Required range: 0 <= x <= 1
Example:

0.9

frequencyPenalty
number

Frequency penalty

Required range: -2 <= x <= 2
Example:

0.3

presencePenalty
number

Presence penalty

Required range: -2 <= x <= 2
Example:

0.2

stop
string[]

Stop sequences

Example:
["END", "STOP"]
seed
number

Seed for reproducible outputs

Example:

12345

tools
object[]

Tools available for the model to call

responseFormat
object

Response format for structured output

Example:
{ "type": "json_object" }
thinking
object

Enable extended thinking/reasoning for supported models

Example:
{ "type": "enabled", "budgetTokens": 5000 }
serverTools
string[]

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? }.