Chat completion
Generate a chat completion based on the provided messages. The response shown below is for non-streaming. To learn about streaming responses, see the chat completion guide.
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
Specifies the model to be used for generating responses. The chat model is always palmyra-x-004
for conversational use.
An array of message objects that form the conversation history or context for the model to respond to. The array must contain at least one message.
Defines the maximum number of tokens (words and characters) that the model can generate in the response. The default value is set to 16, but it can be adjusted to allow for longer or shorter responses as needed.
Controls the randomness or creativity of the model's responses. A higher temperature results in more varied and less predictable text, while a lower temperature produces more deterministic and conservative outputs.
Sets the threshold for "nucleus sampling," a technique to focus the model's token generation on the most likely subset of tokens. Only tokens with cumulative probability above this threshold are considered, controlling the trade-off between creativity and coherence.
Specifies the number of completions (responses) to generate from the model in a single request. This parameter allows multiple responses to be generated, offering a variety of potential replies from which to choose.
A token or sequence of tokens that, when generated, will cause the model to stop producing further content. This can be a single token or an array of tokens, acting as a signal to end the output.
Specifies whether to return log probabilities of the output tokens.
Indicates whether the response should be streamed incrementally as it is generated or only returned once fully complete. Streaming can be useful for providing real-time feedback in interactive applications.
An array of tools described to the model using JSON schema that the model can use to generate responses. Passing graph IDs will automatically use the Knowledge Graph tool.
Configure how the model will call functions: auto
will allow the model to automatically choose the best tool, none
disables tool calling. You can also pass a specific previously defined function.
Additional options for streaming.
Response
A globally unique identifier (UUID) for the response generated by the API. This ID can be used to reference the specific operation or transaction within the system for tracking or debugging purposes.
The type of object returned, which is always chat.completion
for chat responses.
chat.completion
An array of objects representing the different outcomes or results produced by the model based on the input provided.
The Unix timestamp (in seconds) when the response was created. This timestamp can be used to verify the timing of the response relative to other events or operations.
Identifies the specific model used to generate the response.
Usage information for the chat completion response. Please note that at this time Knowledge Graph tool usage is not included in this object.
A string representing the backend configuration that the model runs with.
The service tier used for processing the request.