Advanced OpenAI Options
OpenAI endpoints support additional options that give you finer control over how requests are handled. These options are set as query parameters and only apply to OpenAI endpoints.
Model Forcing
⚠️
This only works for OpenAI endpoints!
There is an optional query parameter for OpenAI endpoints: forceModel
This parameter can only be true, auto or false. Defaults to auto.
- If it is
true, the API will try to find responses with your requested model. - If it is
auto, the API will try to find responses with your requested model. If not found, will return first valid response. - If it is
false, the API will return first valid response.
Example Request Body With forceModel
{
"forceModel": true,
"messages": [
{
"role": "user",
"content": "Who are you?"
}
]
}overwriteOnError
⚠️
This only works for OpenAI endpoints!
If you set the overwriteOnError query parameter to true (defaults to true), PurAI will try other AIs instead of OpenAI if OpenAI returns an error.
Example Request Body With overwriteOnError
{
"overwriteOnError": true,
"messages": [
{
"role": "user",
"content": "Who are you?"
}
]
}Last updated on