POST /{workspace}/{project}/{assistant}/{environment}
Get completion for a stored assistant. This endpoint invokes the assistant and returns its response. It uses chat completions on the backend and maintains OpenAI-compatible format. Assistants are stateful AI agents that can leverage various model providers and tools, access persistent conversation threads, and execute multiple tools in parallel.
Request
- Base URLhttps://api.langtail.com
- Authnone declared. Required headers: X-API-Key
Path parameters
Your workspace URL slug
Your project URL slug
Your assistant URL slug
Your environment URL slug
Headers
Your Langtail API Key
Request body
Example request
{
"threadId": "thread_123",
"variables": {
"variableName": "Your Value"
},
"messages": [
{
"role": "user",
"content": "Hello"
}
],
"user": "user_123",
"metadata": {
"my_identifier": "my-custom-ID"
},
"seed": 123
}Response
Chat completion response from OpenAI - see https://platform.openai.com/docs/api-reference/chat/object for more details. Note: The response includes an 'x-langtail-thread-id' header containing the unique identifier for the thread associated with this response.
Example response
{
"choices": [
{
"message": {
"content": "I'm sorry, but I'm not able to fulfill this request."
}
}
]
}Changes
No recorded changes to this operation across all 1 revision of this API.