Chat Completions
Create a guarded chat completion
Generate a chat completion with guardrails applied.
The request shape is compatible with the OpenAI Chat Completions API and accepts Guardrails-specific options in the guardrails object.
post/v1/chat/completions
Request body
Example request
{
"model": "meta/llama-3.1-8b-instruct",
"messages": [
{
"role": "user"
}
]
}Response
Chat completion response or server-sent event stream.
Example response
{
"object": "chat.completion",
"choices": [
{
"message": {
"role": "user"
}
}
]
}