POST
/
v1
/
chat
/
completions

Authorizations

Authorization
string
headerrequired

Bearer authentication header.

Bearer Galadriel-API-key

Get API key from Galadriel dashboard.

Body

application/json
messages
object[]
required

A list of messages comprising the conversation so far.

model
string
required

ID of the model to use. Get ID for available models.

frequency_penalty
number | null

Number between -2.0 and 2.0. 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.

logit_bias
object | null

Modify the likelihood of specified tokens appearing in the completion.

logprobs
boolean | null
default: false

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.

top_logprobs
integer | null

An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to true if this parameter is used.

max_tokens
integer | null

The maximum number of tokens to generate in the chat completion.

n
integer | null

How many chat completion choices to generate for each input message.

presence_penalty
default: 0

Number between -2.0 and 2.0. 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.

response_format
object | null

An object specifying the format that the model must output. Compatible with GPT-4o, GPT-4o mini, GPT-4 Turbo and all GPT-3.5 Turbo models newer than gpt-3.5-turbo-1106.

seed
integer | null

This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed, and you should refer to the system_fingerprint response parameter to monitor changes in the backend.

stop

Up to 4 sequences where the API will stop generating further tokens.

stream
boolean | null
default: false

If set, partial message deltas will be sent, like in ChatGPT.

stream_options
object | null

Options for streaming response. Only set this when you set stream: true.

temperature
number | null
default: 1

What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

top_p
number | null
default: 1

An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

Response

200 - application/json
id
string
required
choices
object[]
required
created
integer
required
model
string
required
object
enum<string>
required
Available options:
chat.completion
service_tier
enum<string> | null
Available options:
scale,
default
system_fingerprint
string | null
usage
object | null