Create a chat completion
OpenAI compatible chat completions endpoint. If the model does not respond in time, the request will be timed out and the prediction will be cancelled.
In: header
The model to use for this OpenAI compatible endpoint. Models must be in the following format: model_owner/model_name or model_owner/model_name:version_number.
A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, vision, and audio.
Parameters for audio output.
Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
Modify the likelihood of specified tokens appearing in the completion.
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.
An upper bound for the number of tokens that can be generated for a completion.
Output types that you would like the model to generate. Most models are capable of generating text, which is the default: ["text"]. To request that this model generate both text and audio responses, you can use: ["text", "audio"].
How many chat completion choices to generate for each input message.
Whether to enable parallel tool calls during tool use.
falseStatic predicted output content, such as the content of a text file that is being regenerated.
Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
Constrains effort on reasoning for reasoning models.
Stop sequence(s) where the API will stop generating further tokens.
What sampling temperature to use.
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
Controls which (if any) tool is called by the model. none means the model will not call any tool and instead generates a message. auto means the model can pick between generating a message or calling one or more tools. required means the model must call one or more tools. Specifying a particular tool via {"type": "function", "function": {"name": "my_function"}} forces the model to call that tool. none is the default when no tools are present. auto is the default if tools are present.
A list of tools the model may call.
An integer specifying the number of most likely tokens to return at each token position, each with an associated log probability.
Constrains the verbosity of the model's response. Lower values will result in more concise responses, while higher values will result in more verbose responses.
Response Body
curl -X POST "https://api.wrift.ai/v1/chat/completions" \ -H "Content-Type: application/json" \ -d '{ "model": "string", "messages": [ { "content": "string", "role": "developer" } ] }'{
"id": "string",
"choices": [
{
"finish_reason": "stop",
"index": 0,
"logprobs": {
"content": [
{
"token": "string",
"bytes": [
0
],
"logprob": 0,
"top_logprobs": {
"token": "string",
"bytes": [
0
],
"logprob": 0
}
}
],
"refusal": [
{
"token": "string",
"bytes": [
0
],
"logprob": 0,
"top_logprobs": {
"token": "string",
"bytes": [
0
],
"logprob": 0
}
}
]
},
"message": {
"content": "string",
"refusal": "string",
"role": "assistant",
"audio": {
"id": "string",
"data": "string",
"transcript": "string"
},
"tool_calls": [
{
"id": "string",
"function": {
"arguments": "string",
"name": "string"
},
"type": "function"
}
]
}
}
],
"created": 0,
"model": "string",
"object": "chat.completion",
"system_fingerprint": "string",
"usage": {
"completion_tokens": 0,
"prompt_tokens": 0,
"total_tokens": 0,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0
},
"prompt_tokens_details": {
"audio_tokens": 0,
"cached_tokens": 0
}
}
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}Update a model PATCH
This endpoint uses PATCH semantics, meaning only the fields provided in the request body will be updated; all other fields remain unchanged.
Create an embedding POST
OpenAI compatible embeddings endpoint. If the model does not respond in time, the request will be timed out and the prediction will be cancelled.