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.

Changes

Changed in 31 of the 43 revisions of this API.3840156

  • ea91f46f212a22See the full diff
    • the response's property type changed from object to no type for status

      response-property-type-changed

    • removed the required property / from the response with the status

      response-required-property-removed

    • added the new qwen/qwen3.6-27b enum value to the request property /

      request-property-enum-value-added

    • added to the response property allOf list for the response status

      response-property-all-of-added

    • added to the ///// request property oneOf list

      request-property-one-of-added

    • added to the ///// request property oneOf list

      request-property-one-of-added

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • added the optional property to the response with the status

      response-optional-property-added

    • added the optional property to the response with the status

      response-optional-property-added

    • added the optional property / to the response with the status

      response-optional-property-added

    • added the optional property / to the response with the status

      response-optional-property-added

    • added the optional property //// to the response with the status

      response-optional-property-added

    • added the optional property //// to the response with the status

      response-optional-property-added

    • added the optional property to the response with the status

      response-optional-property-added

    • added the optional property /// to the response with the status

      response-optional-property-added

  • 498dee72535c123See the full diff
    • added the new required request property //

      new-required-request-property

    • removed the request property //

      request-property-removed

    • removed the request property

      request-property-removed

    • added the new optional request property

      new-optional-request-property

    • added the new optional request property //

      new-optional-request-property

    • added the optional property ///// to the response with the status

      response-optional-property-added

    • added the new optional request property

      new-optional-request-property

    • added the new optional request property

      new-optional-request-property

    • added the new optional request property ///

      new-optional-request-property

  • 7b46be9995c0310See the full diff
    • removed the enum value llama-guard-3-8b of the request property /

      request-property-enum-value-removed

    • removed the enum value llama3-70b-8192 of the request property /

      request-property-enum-value-removed

    • removed the enum value llama3-8b-8192 of the request property /

      request-property-enum-value-removed

    • added the new optional request property /

      new-optional-request-property

    • added the new compound-beta enum value to the request property /

      request-property-enum-value-added

    • added the new compound-beta-mini enum value to the request property /

      request-property-enum-value-added

    • added the new meta-llama/llama-4-maverick-17b-128e-instruct enum value to the request property /

      request-property-enum-value-added

    • added the new meta-llama/llama-4-scout-17b-16e-instruct enum value to the request property /

      request-property-enum-value-added

    • added the new meta-llama/llama-guard-4-12b enum value to the request property /

      request-property-enum-value-added

    • added the new moonshotai/kimi-k2-instruct enum value to the request property /

      request-property-enum-value-added

    • added the new openai/gpt-oss-120b enum value to the request property /

      request-property-enum-value-added

    • added the new openai/gpt-oss-20b enum value to the request property /

      request-property-enum-value-added

    • added the new qwen/qwen3-32b enum value to the request property /

      request-property-enum-value-added

    • removed subschema #1 from the request property anyOf list

      request-property-any-of-removed

    • request property was restricted to a list of enum values

      request-property-became-enum

    • removed the enum value browser_search of the request property //

      request-property-enum-value-removed

    • removed the enum value code_interpreter of the request property //

      request-property-enum-value-removed

    • removed the enum value function of the request property //

      request-property-enum-value-removed

    • the request property type changed from no type to string

      request-property-type-changed

    • the // request property type changed from string to no type

      request-property-type-changed

    • added the new optional request property

      new-optional-request-property

    • added the new optional request property

      new-optional-request-property

    • added subschema #1 subschema #2 to the // request property anyOf list

      request-property-any-of-added

    • added the new default enum value to the request property

      request-property-enum-value-added

    • added the new high enum value to the request property

      request-property-enum-value-added

    • added the new low enum value to the request property

      request-property-enum-value-added

    • added the new medium enum value to the request property

      request-property-enum-value-added

    • added the new none enum value to the request property

      request-property-enum-value-added

    • removed the enum value default of the request property

      request-property-enum-value-removed

    • removed the enum value none of the request property

      request-property-enum-value-removed

    • the request property type changed from string to no type

      request-property-type-changed

    • added the new optional request property

      new-optional-request-property

    • added subschema #1 to the request property anyOf list

      request-property-any-of-added

    • added developer discriminator mapping keys to the / request property

      request-property-discriminator-mapping-added

    • added the new browser_search enum value to the request property //

      request-property-enum-value-added

    • added the new code_interpreter enum value to the request property //

      request-property-enum-value-added

    • added the new developer enum value to the request property ///

      request-property-enum-value-added

    • the request property // became optional

      request-property-became-optional