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"
}
}
]
}Changes
Changed in 1 of the 3 revisions of this API.11
- ●
removed the optional property
from the response with the statusresponse-optional-property-removed
- ○
added the required property
to the response with the statusresponse-required-property-added
- ●