Guardrail check request

View as Markdown
Chat completion for the provided conversation.

Path parameters

workspacestringRequired

Request

This endpoint expects an object.
modelstringRequired
The model to use for completion. Must be one of the available models.
messageslist of objectsRequired
A list of messages comprising the conversation so far
response_formatmap from strings to anyOptional

Format of the response. Use {‘type’: ‘json_object’} for JSON mode or {‘type’: ‘json_schema’, ‘json_schema’: {…}} for structured outputs.

max_tokensintegerOptional>=1
The maximum number of tokens that can be generated in the chat completion.
nintegerOptional>=1
How many chat completion choices to generate for each input message.
streambooleanOptionalDefaults to false
If set, partial message deltas will be sent, like in ChatGPT.
temperaturedoubleOptional0-2
What sampling temperature to use, between 0 and 2.
top_pdoubleOptional0-1
An alternative to sampling with temperature, called nucleus sampling.
stopstring or list of stringsOptional
Up to 4 sequences where the API will stop generating further tokens.
frequency_penaltydoubleOptional-2-2
Positive values penalize new tokens based on their existing frequency in the text.
presence_penaltydoubleOptional-2-2
Positive values penalize new tokens based on whether they appear in the text so far.
function_callstring or map from strings to anyOptional

Deprecated in favor of tool_choice. ‘none’ means the model will not call a function and instead generates a message. ‘auto’ means the model can pick between generating a message or calling a function. Specifying a particular function via {‘name’: ‘my_function’} forces the model to call that function.

seedintegerOptional
If specified, attempts to sample deterministically.
logit_biasmap from strings to doublesOptional

Modify the likelihood of specified tokens appearing in the completion. Maps token IDs (as strings) to bias values from -100 to 100.

top_logprobsintegerOptional0-20
The number of most likely tokens to return at each token position.
logprobsbooleanOptional
Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the content of message
tool_choicestring or map from strings to anyOptional

Controls which (if any) tool is called by the model. ‘none’ means no tool is called, ‘auto’ lets the model decide, ‘required’ forces a tool call.

userstringOptional

A unique identifier representing your end-user, used by some providers for abuse monitoring.

toolslist of maps from strings to anyOptional
A list of tools the model may call. Each tool is an object with a 'type' field and a 'function' definition.
ignore_eosbooleanOptional
Ignore the eos when running
reasoning_effortstringOptional
Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
max_completion_tokensintegerOptional>=1

An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. Preferred over max_tokens for reasoning models.

stream_optionsmap from strings to booleansOptional

Options for streaming response. Only set this when stream=True. Supports include_usage to receive token usage in the final stream chunk.

visionbooleanOptional

Whether this is a vision-capable request with image inputs.

guardrailsobjectOptional
Guardrails specific options for the request.

Response

Successful Response
statusenum
Overall status indicating if all rails passed or if any failed.
rails_statusmap from strings to objects
Dictionary mapping each rail to its status.
guardrails_dataobject
Additional data related to guardrails.

Errors

400
Bad Request Error
422
Unprocessable Entity Error
500
Internal Server Error