Skip to main content
POST
/
v3
/
llm
/
chat
/
completions
Chat Completions
curl --request POST \
  --url https://api.edenai.run/v3/llm/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "messages": [
    {
      "role": "user",
      "content": "<string>"
    }
  ],
  "router_candidates": [
    "<string>"
  ],
  "n": 1,
  "reasoning_effort": "low",
  "metadata": [
    {}
  ],
  "frequency_penalty": 0,
  "logit_bias": {},
  "logprobs": false,
  "top_logprobs": 10,
  "max_tokens": 2,
  "max_completion_tokens": 2,
  "modalities": [
    "<string>"
  ],
  "prediction": {},
  "audio": {},
  "presence_penalty": 0,
  "response_format": {},
  "seed": 123,
  "service_tier": "auto",
  "stop": [
    "<string>"
  ],
  "stream": false,
  "stream_options": {},
  "temperature": 1,
  "top_p": 1,
  "tools": [
    {}
  ],
  "tool_choice": "<string>",
  "parallel_tool_calls": true,
  "user": "<string>",
  "function_call": {},
  "functions": [
    {}
  ],
  "thinking": {},
  "web_search_options": {},
  "verbosity": "low"
}
'
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
string
required

The name of the LLM model to use.

messages
Message · object[]
required

The messages to send to the LLM model.

router_candidates
string[] | null

List of model candidates for dynamic routing when using model='@edenai'. If not provided, defaults to all available models.

n
integer | null
default:1

The number of completions to generate for each prompt. Defaults to 1.

Required range: x >= 1
reasoning_effort
enum<string> | null

The reasoning effort level for the LLM model.

Available options:
low,
medium,
high
metadata
Metadata · object[] | null

list of metadata associated with the chat request. Can be used to provide additional context or tracking information.

frequency_penalty
number | null

Penalty for repeated tokens in the output.

Required range: -2 <= x <= 2
logit_bias
Logit Bias · object

Logit bias to influence token generation.

logprobs
boolean | null
default:false

Whether to include log probabilities of tokens in the output. Defaults to False.

top_logprobs
integer | null

Number of top log probabilities to return with each token.

Required range: 1 <= x <= 20
max_tokens
integer | null

The maximum number of tokens to generate in the chat completion

Required range: x >= 1
max_completion_tokens
integer | null

An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens.

Required range: x >= 1
modalities
string[] | null

List of supported input/output modalities for the chat.

prediction
Prediction · object

field for storing prediction-related information.

audio
Audio · object

dictionary for audio-related parameters or metadata.

presence_penalty
number | null

Penalty for new tokens based on their presence in the text so far.

Required range: -2 <= x <= 2
response_format
Response Format · object

Specify the desired response format for the completion.

seed
integer | null

Seed for random number generation.

service_tier
enum<string> | null

'auto': Automatically select appropriate tier 'default': Use the default service tier

Available options:
auto,
default
stop
string[] | null

List of stop sequences to end the generation.

stream
boolean | null
default:false

Whether to stream the response in real-time. Defaults to False.

stream_options
Stream Options · object

Options for streaming responses, such as chunk size or format.

temperature
number | null

Sampling temperature for controlling randomness in output.

Required range: 0 <= x <= 2
top_p
number | null
default:1

Nucleus sampling parameter for controlling diversity in output. Defaults to 1.0.

Required range: 0 <= x <= 1
tools
Tools · object[] | null

List of tools that can be used by the model to assist in generating responses.

tool_choice

Specify how tools should be used. Can be 'auto', 'required', 'none', or an object like {'type': 'function', 'function': {'name': 'tool_name'}} to force a specific tool.

parallel_tool_calls
boolean | null

Whether to allow parallel tool calls in the completion.

user
string | null

User identifier for tracking or personalization purposes.

function_call
Function Call · object

Function call parameters for invoking specific functions during the chat.

functions
Functions · object[] | null

List of functions that can be called by the model to assist in generating responses.

thinking
Thinking · object

Parameters related to the model's reasoning or thinking process.

web_search_options
Web Search Options · object

Options for web search integration. Example: json web_search_options={ "search_context_size": "medium" # Options: "low", "medium", "high" }

verbosity
enum<string> | null

Hint the model to be more or less expansive in its replies. Values: "low", "medium", "high". low (gpt5 models)

Available options:
low,
medium,
high

Response

Successful Response