v42

latestOpenAPI 3.0.3raw.githubusercontent.com2026-07-2129120150.2 KB
Generation API

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.

post/v1/chat

Request body

modelstring required

The ID of the model to use for creating the chat completion. Supports palmyra-x5, palmyra-x4, palmyra-fin, palmyra-med, palmyra-creative, and palmyra-x-003-instruct.

max_tokensinteger

Defines the maximum number of tokens (words and characters) that the model can generate in the response. This can be adjusted to allow for longer or shorter responses as needed. The maximum value varies by model. See the models overview for more information about the maximum number of tokens for each model.

temperaturenumber double

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.

top_pnumber double

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.

ninteger

Specifies the number of completions (responses) to generate from the model in a single request. This parameter allows for generating multiple responses, offering a variety of potential replies from which to choose.

logprobsboolean

Specifies whether to return log probabilities of the output tokens.

streamboolean

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.

Response

Successful response

idstring uuid required

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.

object'chat.completion' required

The type of object returned, which is always chat.completion for chat responses.

createdinteger required

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.

modelstring required

Identifies the specific model used to generate the response.

system_fingerprintstring

A string representing the backend configuration that the model runs with.

service_tierstring

The service tier used for processing the request.