agents

Agents Completion

Changed on

Agents Completion

post/v1/agents/completions

Request

Request body

max_tokensinteger nullable

The maximum number of tokens to generate in the completion. The token count of your prompt plus max_tokens cannot exceed the model's context length.

streamboolean

Whether to stream back partial progress. If set, tokens will be sent as data-only server-side events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON.

random_seedinteger nullable

The seed to use for random sampling. If set, different calls will generate deterministic results.

metadataobject nullable
presence_penaltynumber nullable

The presence_penalty determines how much the model penalizes the repetition of words or phrases. A higher presence penalty encourages the model to use a wider variety of words and phrases, making the output more diverse and creative.

frequency_penaltynumber nullable

The frequency_penalty penalizes the repetition of words based on their frequency in the generated text. A higher frequency penalty discourages the model from repeating words that have already appeared frequently in the output, promoting diversity and reducing repetition.

min_tokensinteger nullable
repetition_penaltynumber nullable
top_kinteger nullable
logprobsboolean nullable
top_logprobsinteger nullable
prompt_logprobsboolean nullable
top_prompt_logprobsinteger nullable
ninteger nullable

Number of completions to return for each request, input tokens are only billed once.

parallel_tool_callsboolean
reasoning_effort'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh'
prompt_mode'reasoning'

Available options to the prompt_mode argument on the chat completion endpoint. Values represent high-level intent. Assignment to actual SPs is handled internally. System prompt may include knowledge cutoff date, model capabilities, tone to use, safety guidelines, etc.

prompt_cache_keystring nullable
service_tier'auto' | 'standard_only'
agent_idstring required

The ID of the agent to use for this completion.

Example request

{
  "messages": [
    {
      "role": "user",
      "content": "Who is the best French painter? Answer in one short sentence."
    }
  ],
  "response_format": {
    "type": "text"
  }
}

Response

Successful Response

idstring required
objectstring required
modelstring required
createdinteger required

Changes

    • breaking

      removed from the // request property oneOf list

    • breaking

      added to the ////// response property oneOf list for the response status

    • breaking

      added to the /////// response property oneOf list for the response status

    • warning

      added the new mistral_mcp enum value to the //////////// response property for the response status

    • warning

      added the new mistral_mcp enum value to the ///////////// response property for the response status

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added resource resource_link discriminator mapping keys to the ///// request property

    • info

      added resource resource_link discriminator mapping keys to the ///// request property

    • info

      added resource resource_link discriminator mapping keys to the ///// request property

    • info

      removed web_search web_search_premium code_interpreter discriminator mapping keys from the // request property

    • info

      added the new mistral_mcp enum value to the request property ///////////

    • info

      added the new mistral_mcp enum value to the request property ///////////

    • info

      added the new mistral_mcp enum value to the request property ///////////

    • info

      added the new mistral_mcp enum value to the request property ///////////

    • info

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

    • info

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

    • info

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

    • info

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

    • info

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

    • info

      added resource resource_link discriminator mapping keys to the ////// response property for the response status

    • info

      added resource resource_link discriminator mapping keys to the /////// response property for the response status

    • info

      added the new optional request property

    • info

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