Example Prompt Request
Usage
# Deployed Smarter LLMClient
curl -X POST https://stackademy-sql.3141-5926-5359.api.example.com/prompt/ \
-H "Content-Type: application/json" \
-d '{"messages": [{"role": "user", "content": "hello world"}]}'
# Smarter platform api, by the LLMClient's id
curl -X POST http://localhost:9357/api/v1/llm-clients/9/prompt/ \
-H "Content-Type: application/json" \
-H "Authorization: Token <YOUR-API-KEY>" \
-d '{"session_key": "<SESSION-KEY>", "messages": [{"role": "user", "content": "hello world"}]}'
Note
There are multiple possible hosts and paths that lead to this endpoint, depending on your use case.
See also
class reference
smarter.apps.prompt.views.PromptWorkbenchView
Example JSON Object
Example request body, sent by the chat UI to the Smarter API
{
"method": "POST",
"credentials": "include",
"mode": "cors",
"headers": {
"Accept": "application/json",
"Content-Type": "application/json",
"X-CSRFToken": "lgjxDjRgTuJdAvz1Heelp7dpE4D1qVgwwfrLyJHevl192cOXvgCd2UoAGuDfjdlN",
"Origin": "http://localhost:9357",
"Cookie": "session_key=e5c0368d6d7201b60f4f20c470f4b5ba36faf45e80ddbe8b04b6cf20f33167a7; _ga=GA1.1.1976586847.1763392590; _ga_2VG1QMYW93=GS2.1.s1763390277$o8$g1$t1763393028$j60$l0$h0; sidebar_minimize_state=on; _ga_SK81M5HQYS=GS2.1.s1765200895$o13$g1$t1765201045$j57$l0$h0",
"Authorization": "Bearer <SMARTER_API_KEY>",
"User-Agent": "SmarterChat/1.0"
},
"body": {
"session_key": "e5c0368d6d7201b60f4f20c470f4b5ba36faf45e80ddbe8b04b6cf20f33167a7",
"messages": [
{
"role": "system",
"content": "The current date/time is Monday, 2025-12-08T13:37:26+0000\nYou are a helpful assistant. When given the opportunity to utilize function calling, you should always do so. This will allow you to provide the best possible responses to the user. DO NOT GUESS. IF\n YOU DON'T KNOW THE ANSWER, RESPOND THAT YOU DON'T KNOW.\n"
},
{
"role": "assistant",
"content": "Welcome to Stackademy! How can I help you today?"
},
{
"role": "assistant",
"content": "Some example prompts to get you started:\r\n\r\nDo you offer any courses on AI?\r\nMy budget is $1,000. What courses can I take?\r\nI want to study programming. What do you suggest?\r\n"
},
{
"role": "user",
"content": "Do you offer any courses on AI?"
}
]
}
}