Skip to main content
POST
/
agent
/
{agentName}
/
chat
Chat with agent by name
curl --request POST \
  --url https://{controlPlaneURL}/api/llm/agent/{agentName}/chat \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "messages": [
    {
      "role": "system",
      "content": "<string>",
      "name": "<string>"
    }
  ],
  "stream": true,
  "iteration_limit": 25,
  "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.

Path Parameters

agentName
string
required

The name of the agent to use for configuration

Body

application/json

Chat parameters. The prompt version FQN is automatically resolved from the agent configuration. prompt_variables can be provided to hydrate the prompt template.

messages
(System Message · object | User Message · object | Assistant Message · object | Function Message · object | Tool Message · object | Developer Message · object)[]

A list of messages comprising the conversation history

stream
boolean | null

Whether to stream responses

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
prompt_variables
object

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

Response

Chat completions response with tool calls using agent configuration

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