Skip to main content
POST
/
agent
/
chat
/
completions
Chat with external tools integrated
curl --request POST \
  --url https://{controlPlaneURL}/api/llm/agent/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "agent_name": "<string>",
  "model": "<string>",
  "messages": "<unknown>",
  "mcp_servers": [
    {
      "enable_all_tools": true,
      "integration_fqn": "<string>",
      "url": "<string>",
      "name": "<string>",
      "headers": {},
      "tools": [
        {
          "name": "<string>"
        }
      ]
    }
  ],
  "sub_agents": [
    {
      "name": "<string>"
    }
  ],
  "max_tokens": 123,
  "temperature": 123,
  "top_p": 123,
  "stream": true,
  "top_k": 123,
  "iteration_limit": 25,
  "response_format": "<unknown>",
  "prompt_version_fqn": "<string>",
  "prompt_variables": {}
}
'
{
  "object": "chat.completion.chunk",
  "created": 123,
  "model": "<string>",
  "choices": [
    {
      "index": 123,
      "delta": {
        "content": "<string>",
        "role": "<string>",
        "refusal": "<unknown>"
      },
      "finish_reason": "<string>",
      "logprobs": "<unknown>"
    }
  ],
  "id": "<string>",
  "service_tier": "<string>",
  "system_fingerprint": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://www.truefoundry.com/llms.txt

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

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Parameters for generating completions with external tools.

agent_name
string

The name of the agent to use. When provided, model, mcp_servers, and other configuration are auto-filled from the agent configuration.

model
string

Model Name. Required when neither agent_name nor prompt_version_fqn is provided.

messages
any

A list of messages comprising the conversation history

mcp_servers
object[]

A list of MCP servers (identified by FQN, name, or URL) and their tools

sub_agents
object[]

A list of sub-agents to use

max_tokens
number | null

Maximum number of tokens to generate

temperature
number | null

Sampling temperature to control randomness

top_p
number | null

Nucleus sampling parameter

stream
boolean | null

Whether to stream responses

top_k
number | null

Top-k sampling parameter

iteration_limit
integer

Maximum number of iterations to perform with tool calls. Must be a positive integer. Defaults to 5.

Required range: 0 < x <= 50
response_format
any

Response format specification for structured output

prompt_version_fqn
string | null

Fully qualified name (FQN) of the prompt template to use for automatic prompt hydration.

prompt_variables
object

Key-value pairs of variables to substitute in the prompt template when using prompt_version_fqn.

Response

Chat completions response with tool calls

object
enum<string>
required
Available options:
chat.completion.chunk
created
number
required
model
string
required
choices
object[]
required
id
string
service_tier
string
system_fingerprint
string