v45

latestOpenAPI 3.0.1raw.githubusercontent.com2026-06-2223106188.8 KB
Chat

Creates a model response for the given chat conversation.

post/openai/v1/chat/completions

Request body

disable_tool_validationboolean

If set to true, groq will return called tools without validating that the tool is present in request.tools. tool_choice=required/none will still be enforced, but the request cannot require a specific tool be used.

frequency_penaltynumber nullable

This is not yet supported by any of our models. 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.

include_reasoningboolean nullable

Whether to include reasoning in the response. If true, the response will include a reasoning field. If false, the model's reasoning will not be included in the response. This field is mutually exclusive with reasoning_format.

logit_biasobject nullable

This is not yet supported by any of our models. Modify the likelihood of specified tokens appearing in the completion.

logprobsboolean nullable

This is not yet supported by any of our models. 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_logprobsinteger nullable

This is not yet supported by any of our models. 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_tokensinteger nullable

Deprecated in favor of max_completion_tokens. The maximum number of tokens that can be generated in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length.

max_completion_tokensinteger nullable

The maximum number of tokens that can be generated in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length.

ninteger nullable

How many chat completion choices to generate for each input message. Note that the current moment, only n=1 is supported. Other values will result in a 400 response.

presence_penaltynumber nullable

This is not yet supported by any of our models. 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.

seedinteger nullable

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.

service_tier'auto' | 'on_demand' | 'flex' | 'performance' | 'null' nullable

The service tier to use for the request. Defaults to on_demand.

  • auto will automatically select the highest tier available within the rate limits of your organization.
  • flex uses the flex tier, which will succeed or fail quickly.
reasoning_effort'none' | 'default' | 'low' | 'medium' | 'high' nullable

qwen3 models support the following values Set to 'none' to disable reasoning. Set to 'default' or null to let Qwen reason.

openai/gpt-oss-20b and openai/gpt-oss-120b support 'low', 'medium', or 'high'. 'medium' is the default value.

reasoning_format'hidden' | 'raw' | 'parsed' nullable

Specifies how to output reasoning tokens This field is mutually exclusive with include_reasoning.

streamboolean nullable

If set, partial message deltas will be sent. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Example code.

temperaturenumber nullable

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. We generally recommend altering this or top_p but not both.

top_pnumber nullable

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. We generally recommend altering this or temperature but not both.

parallel_tool_callsboolean nullable

Whether to enable parallel function calling during tool use.

userstring nullable

A unique identifier representing your end-user, which can help us monitor and detect abuse.

metadataobject nullable

This parameter is not currently supported.

storeboolean nullable

This parameter is not currently supported.

include_domainsstring[] nullable

Deprecated: Use search_settings.include_domains instead. A list of domains to include in the search results when the model uses a web search tool.

exclude_domainsstring[] nullable

Deprecated: Use search_settings.exclude_domains instead. A list of domains to exclude from the search results when the model uses a web search tool.

citation_options'enabled' | 'disabled' nullable

Whether to enable citations in the response. When enabled, the model will include citations for information retrieved from provided documents or web searches.

Example request

{
  "n": 1,
  "stop": "\n",
  "temperature": 1,
  "top_p": 1
}

Response

OK

idstring required

A unique identifier for the chat completion.

createdinteger required

The Unix timestamp (in seconds) of when the chat completion was created.

modelstring required

The model used for the chat completion.

system_fingerprintstring

This fingerprint represents the backend configuration that the model runs with.

Can be used in conjunction with the seed request parameter to understand when backend changes have been made that might impact determinism.

object'chat.completion' required

The object type, which is always chat.completion.

service_tier'auto' | 'on_demand' | 'flex' | 'performance' | 'null' nullable

The service tier used for the request.