---
title: "Batch Completions"
method: POST
path: "/v2/batch-completions"
---

# Batch Completions

`POST /v2/batch-completions`

## Request body

- CreateBatchCompletionsV2Request — Request object for batch completions.
  - `input_data_path` string, nullable — Path to the input file. The input file should be a JSON file of type List[CreateBatchCompletionsRequestContent].
  - `output_data_path` string, required — Path to the output file. The output file will be a JSON file of type List[CompletionOutput].
  - `labels` object — Labels to attach to the batch inference job.
  - `data_parallelism` integer, nullable — Number of replicas to run the batch inference. More replicas are slower to schedule but faster to inference.
  - `max_runtime_sec` integer, nullable — Maximum runtime of the batch inference in seconds. Default to one day.
  - `priority` string, nullable — Priority of the batch inference job. Default to None.
  - `tool_config` ToolConfig — Configuration for tool use. NOTE: this config is highly experimental and signature will change significantly in future iterations.
    - `name` string, required
    - `max_iterations` integer, nullable
    - `execution_timeout_seconds` integer, nullable
    - `should_retry_on_error` boolean, nullable
  - `cpus` union — CPUs to use for the batch inference.
    - string
    - integer
    - number
  - `gpus` integer, nullable — Number of GPUs to use for the batch inference.
  - `memory` union — Amount of memory to use for the batch inference.
    - string
    - integer
    - number
  - `gpu_type` 'nvidia-tesla-t4' | 'nvidia-ampere-a10' | 'nvidia-ampere-a100' | 'nvidia-ampere-a100e' | 'nvidia-hopper-h100' | 'nvidia-hopper-h100-1g20gb' | 'nvidia-hopper-h100-3g40gb' — Lists allowed GPU types for Launch.
  - `storage` union — Storage to use for the batch inference.
    - string
    - integer
    - number
  - `nodes_per_worker` integer, nullable — Number of nodes per worker for the batch inference.
  - `content` union — Either `input_data_path` or `content` needs to be provided. When input_data_path is provided, the input file should be a JSON file of type List[CreateBatchCompletionsRequestContent].
    - CreateBatchCompletionsV1RequestContent
      - `prompts` string[], required
      - `max_new_tokens` integer, required
      - `temperature` number, required
      - `stop_sequences` string[], nullable
      - `return_token_log_probs` boolean, nullable
      - `presence_penalty` number, nullable
      - `frequency_penalty` number, nullable
      - `top_k` integer, nullable
      - `top_p` number, nullable
      - `skip_special_tokens` boolean, nullable
    - FilteredCompletionV2Request[]
      - `best_of` integer, nullable — Generates `best_of` completions server-side and returns the "best" (the one with the highest log probability per token). Results cannot be streamed. When used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return – `best_of` must be greater than `n`. **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.
      - `top_k` integer, nullable — Controls the number of top tokens to consider. -1 means consider all tokens.
      - `min_p` number, nullable — Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
      - `use_beam_search` boolean, nullable — Whether to use beam search for sampling.
      - `length_penalty` number, nullable — Float that penalizes sequences based on their length. Used in beam search.
      - `repetition_penalty` number, nullable — Float that penalizes new tokens based on whether they appear in the prompt and the generated text so far. Values > 1 encourage the model to use new tokens, while values < 1 encourage the model to repeat tokens.
      - `early_stopping` boolean, nullable — Controls the stopping condition for beam search. It accepts the following values: `True`, where the generation stops as soon as there are `best_of` complete candidates; `False`, where an heuristic is applied and the generation stops when is it very unlikely to find better candidates; `"never"`, where the beam search procedure only stops when there cannot be better candidates (canonical beam search algorithm).
      - `stop_token_ids` integer[], nullable — List of tokens that stop the generation when they are generated. The returned output will contain the stop tokens unless the stop tokens are special tokens.
      - `include_stop_str_in_output` boolean, nullable — Whether to include the stop strings in output text.
      - `ignore_eos` boolean, nullable — Whether to ignore the EOS token and continue generating tokens after the EOS token is generated.
      - `min_tokens` integer, nullable — Minimum number of tokens to generate per output sequence before EOS or stop_token_ids can be generated
      - `skip_special_tokens` boolean, nullable — Whether to skip special tokens in the output. Only supported in vllm.
      - `spaces_between_special_tokens` boolean, nullable — Whether to add spaces between special tokens in the output. Only supported in vllm.
      - `add_special_tokens` boolean, nullable — If true (the default), special tokens (e.g. BOS) will be added to the prompt.
      - `response_format` union — Similar to chat completion, this parameter specifies the format of output. Only {'type': 'json_object'} or {'type': 'text' } is supported.
        - ResponseFormatText
          - `type` 'text', required — The type of response format being defined. Always `text`.
        - ResponseFormatJsonSchema
          - `type` 'json_schema', required — The type of response format being defined. Always `json_schema`.
          - `json_schema` JsonSchema, required
            - `description` string, nullable — A description of what the response format is for, used by the model to determine how to respond in the format.
            - `name` string, required — The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
            - `schema` ResponseFormatJsonSchemaSchema
            - `strict` boolean, nullable — Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`. To learn more, read the [Structured Outputs guide](/docs/guides/structured-outputs).
        - ResponseFormatJsonObject
          - `type` 'json_object', required — The type of response format being defined. Always `json_object`.
      - `guided_json` object, nullable — JSON schema for guided decoding. Only supported in vllm.
      - `guided_regex` string, nullable — Regex for guided decoding. Only supported in vllm.
      - `guided_choice` string[], nullable — Choices for guided decoding. Only supported in vllm.
      - `guided_grammar` string, nullable — Context-free grammar for guided decoding. Only supported in vllm.
      - `guided_decoding_backend` string, nullable — If specified, will override the default guided decoding backend of the server for this specific request. If set, must be either 'outlines' / 'lm-format-enforcer'
      - `guided_whitespace_pattern` string, nullable — If specified, will override the default whitespace pattern for guided json decoding.
      - `model` string, nullable
      - `prompt` union, required — The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays. Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document.
        - string
        - string[]
        - integer[], nullable — The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays. Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document.
        - Prompt1Item[], nullable — The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays. Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document.
          - integer[]
      - `echo` boolean, nullable — Echo back the prompt in addition to the completion
      - `frequency_penalty` number, nullable — 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. [See more information about frequency and presence penalties.](/docs/guides/text-generation)
      - `logit_bias` object, nullable — Modify the likelihood of specified tokens appearing in the completion. Accepts a JSON object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](/tokenizer?view=bpe) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token from being generated.
      - `logprobs` integer, nullable — Include the log probabilities on the `logprobs` most likely output tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. The maximum value for `logprobs` is 5.
      - `max_tokens` integer, nullable — The maximum number of [tokens](/tokenizer) that can be generated in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model's context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens.
      - `n` integer, nullable — How many completions to generate for each prompt. **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.
      - `presence_penalty` number, nullable — 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. [See more information about frequency and presence penalties.](/docs/guides/text-generation)
      - `seed` integer, 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.
      - `stop` union — Not supported with latest reasoning models `o3` and `o4-mini`. Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
        - string
        - string[], nullable — Not supported with latest reasoning models `o3` and `o4-mini`. Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
      - `stream` boolean, nullable
      - `stream_options` ChatCompletionStreamOptions
        - `include_usage` boolean, nullable — If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value. **NOTE:** If the stream is interrupted, you may not receive the final usage chunk which contains the total token usage for the request.
      - `suffix` string, nullable — The suffix that comes after a completion of inserted text. This parameter is only supported for `gpt-3.5-turbo-instruct`.
      - `temperature` number, 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_p` number, 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.
      - `user` string, nullable — A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).
    - FilteredChatCompletionV2Request[]
      - `best_of` integer, nullable — Number of output sequences that are generated from the prompt. From these `best_of` sequences, the top `n` sequences are returned. `best_of` must be greater than or equal to `n`. This is treated as the beam width when `use_beam_search` is True. By default, `best_of` is set to `n`.
      - `top_k` integer, nullable — Controls the number of top tokens to consider. -1 means consider all tokens.
      - `min_p` number, nullable — Float that represents the minimum probability for a token to be considered, relative to the probability of the most likely token. Must be in [0, 1]. Set to 0 to disable this.
      - `use_beam_search` boolean, nullable — Whether to use beam search for sampling.
      - `length_penalty` number, nullable — Float that penalizes sequences based on their length. Used in beam search.
      - `repetition_penalty` number, nullable — Float that penalizes new tokens based on whether they appear in the prompt and the generated text so far. Values > 1 encourage the model to use new tokens, while values < 1 encourage the model to repeat tokens.
      - `early_stopping` boolean, nullable — Controls the stopping condition for beam search. It accepts the following values: `True`, where the generation stops as soon as there are `best_of` complete candidates; `False`, where an heuristic is applied and the generation stops when is it very unlikely to find better candidates; `"never"`, where the beam search procedure only stops when there cannot be better candidates (canonical beam search algorithm).
      - `stop_token_ids` integer[], nullable — List of tokens that stop the generation when they are generated. The returned output will contain the stop tokens unless the stop tokens are special tokens.
      - `include_stop_str_in_output` boolean, nullable — Whether to include the stop strings in output text. Defaults to False.
      - `ignore_eos` boolean, nullable — Whether to ignore the EOS token and continue generating tokens after the EOS token is generated.
      - `min_tokens` integer, nullable — Minimum number of tokens to generate per output sequence before EOS or stop_token_ids can be generated
      - `skip_special_tokens` boolean, nullable — Whether to skip special tokens in the output. Only supported in vllm.
      - `spaces_between_special_tokens` boolean, nullable — Whether to add spaces between special tokens in the output. Only supported in vllm.
      - `echo` boolean, nullable — If true, the new message will be prepended with the last message if they belong to the same role.
      - `add_generation_prompt` boolean, nullable — If true, the generation prompt will be added to the chat template. This is a parameter used by chat template in tokenizer config of the model.
      - `continue_final_message` boolean, nullable — If this is set, the chat will be formatted so that the final message in the chat is open-ended, without any EOS tokens. The model will continue this message rather than starting a new one. This allows you to "prefill" part of the model's response for it. Cannot be used at the same time as `add_generation_prompt`.
      - `add_special_tokens` boolean, nullable — If true, special tokens (e.g. BOS) will be added to the prompt on top of what is added by the chat template. For most models, the chat template takes care of adding the special tokens so this should be set to false (as is the default).
      - `documents` object[], nullable — A list of dicts representing documents that will be accessible to the model if it is performing RAG (retrieval-augmented generation). If the template does not support RAG, this argument will have no effect. We recommend that each document should be a dict containing "title" and "text" keys.
      - `chat_template` string, nullable — A Jinja template to use for this conversion. As of transformers v4.44, default chat template is no longer allowed, so you must provide a chat template if the model's tokenizer does not define one and no override template is given
      - `chat_template_kwargs` object, nullable — Additional kwargs to pass to the template renderer. Will be accessible by the chat template.
      - `guided_json` object, nullable — JSON schema for guided decoding. Only supported in vllm.
      - `guided_regex` string, nullable — Regex for guided decoding. Only supported in vllm.
      - `guided_choice` string[], nullable — Choices for guided decoding. Only supported in vllm.
      - `guided_grammar` string, nullable — Context-free grammar for guided decoding. Only supported in vllm.
      - `guided_decoding_backend` string, nullable — If specified, will override the default guided decoding backend of the server for this specific request. If set, must be either 'outlines' / 'lm-format-enforcer'
      - `guided_whitespace_pattern` string, nullable — If specified, will override the default whitespace pattern for guided json decoding.
      - `priority` integer, nullable — The priority of the request (lower means earlier handling; default: 0). Any priority other than 0 will raise an error if the served model does not use priority scheduling.
      - `metadata` Metadata, nullable
      - `temperature` number, 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_p` number, 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.
      - `user` string, nullable — A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices#end-user-ids).
      - `service_tier` 'auto' | 'default' | 'flex', nullable — Specifies the latency tier to use for processing the request. This parameter is relevant for customers subscribed to the scale tier service: - If set to 'auto', and the Project is Scale tier enabled, the system will utilize scale tier credits until they are exhausted. - If set to 'auto', and the Project is not Scale tier enabled, the request will be processed using the default service tier with a lower uptime SLA and no latency guarentee. - If set to 'default', the request will be processed using the default service tier with a lower uptime SLA and no latency guarentee. - If set to 'flex', the request will be processed with the Flex Processing service tier. [Learn more](/docs/guides/flex-processing). - When not set, the default behavior is 'auto'. When this parameter is set, the response body will include the `service_tier` utilized.
      - `messages` ChatCompletionRequestMessage[], required — A list of messages comprising the conversation so far. Depending on the [model](/docs/models) you use, different message types (modalities) are supported, like [text](/docs/guides/text-generation), [images](/docs/guides/vision), and [audio](/docs/guides/audio).
        - union
          - ChatCompletionRequestDeveloperMessage
            - `content` union, required — The contents of the developer message.
              - …
            - `role` 'developer', required — The role of the messages author, in this case `developer`.
            - `name` string, nullable — An optional name for the participant. Provides the model information to differentiate between participants of the same role.
          - ChatCompletionRequestSystemMessage
            - `content` union, required — The contents of the system message.
              - …
            - `role` 'system', required — The role of the messages author, in this case `system`.
            - `name` string, nullable — An optional name for the participant. Provides the model information to differentiate between participants of the same role.
          - ChatCompletionRequestUserMessage
            - `content` union, required — The contents of the user message.
              - …
            - `role` 'user', required — The role of the messages author, in this case `user`.
            - `name` string, nullable — An optional name for the participant. Provides the model information to differentiate between participants of the same role.
          - ChatCompletionRequestAssistantMessage
            - `content` union — The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
              - …
            - `refusal` string, nullable — The refusal message by the assistant.
            - `role` 'assistant', required — The role of the messages author, in this case `assistant`.
            - `name` string, nullable — An optional name for the participant. Provides the model information to differentiate between participants of the same role.
            - `audio` Audio
              - …
            - `tool_calls` ChatCompletionMessageToolCall[] — The tool calls generated by the model, such as function calls.
              - …
            - `function_call` FunctionCall
              - …
          - ChatCompletionRequestToolMessage
            - `role` 'tool', required — The role of the messages author, in this case `tool`.
            - `content` union, required — The contents of the tool message.
              - …
            - `tool_call_id` string, required — Tool call that this message is responding to.
          - ChatCompletionRequestFunctionMessage
            - `role` 'function', required — The role of the messages author, in this case `function`.
            - `content` string, nullable — The contents of the function message.
            - `name` string, required — The name of the function to call.
      - `model` string, nullable
      - `modalities` string[], nullable — Output types that you would like the model to generate. Most models are capable of generating text, which is the default: `["text"]` The `gpt-4o-audio-preview` model can also be used to [generate audio](/docs/guides/audio). To request that this model generate both text and audio responses, you can use: `["text", "audio"]`
      - `reasoning_effort` 'low' | 'medium' | 'high', nullable — **o-series models only** Constrains effort on reasoning for [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported values are `low`, `medium`, and `high`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
      - `max_completion_tokens` integer, nullable — An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and [reasoning tokens](/docs/guides/reasoning).
      - `frequency_penalty` number, nullable — 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.
      - `presence_penalty` number, nullable — 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.
      - `web_search_options` WebSearchOptions
        - `user_location` UserLocation
          - `type` 'approximate', required — The type of location approximation. Always `approximate`.
          - `approximate` WebSearchLocation, required
            - `country` string, nullable — The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, e.g. `US`.
            - `region` string, nullable — Free text input for the region of the user, e.g. `California`.
            - `city` string, nullable — Free text input for the city of the user, e.g. `San Francisco`.
            - `timezone` string, nullable — The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the user, e.g. `America/Los_Angeles`.
        - `search_context_size` 'low' | 'medium' | 'high' — High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.
      - `top_logprobs` integer, nullable — 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.
      - `response_format` union — An object specifying the format that the model must output. Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](/docs/guides/structured-outputs). Setting to `{ "type": "json_object" }` enables the older JSON mode, which ensures the message the model generates is valid JSON. Using `json_schema` is preferred for models that support it.
        - ResponseFormatText
          - `type` 'text', required — The type of response format being defined. Always `text`.
        - ResponseFormatJsonSchema
          - `type` 'json_schema', required — The type of response format being defined. Always `json_schema`.
          - `json_schema` JsonSchema, required
            - `description` string, nullable — A description of what the response format is for, used by the model to determine how to respond in the format.
            - `name` string, required — The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
            - `schema` ResponseFormatJsonSchemaSchema
            - `strict` boolean, nullable — Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`. To learn more, read the [Structured Outputs guide](/docs/guides/structured-outputs).
        - ResponseFormatJsonObject
          - `type` 'json_object', required — The type of response format being defined. Always `json_object`.
      - `audio` Audio2
        - `voice` union, required
          - string
          - 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'fable' | 'onyx' | 'nova' | 'sage' | 'shimmer' | 'verse'
        - `format` 'wav' | 'aac' | 'mp3' | 'flac' | 'opus' | 'pcm16', required — Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, `opus`, or `pcm16`.
      - `store` boolean, nullable — Whether or not to store the output of this chat completion request for use in our [model distillation](/docs/guides/distillation) or [evals](/docs/guides/evals) products.
      - `stream` boolean, nullable
      - `stop` union — Not supported with latest reasoning models `o3` and `o4-mini`. Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
        - string
        - string[], nullable — Not supported with latest reasoning models `o3` and `o4-mini`. Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
      - `logit_bias` object, nullable — Modify the likelihood of specified tokens appearing in the completion. Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.
      - `logprobs` boolean, nullable — 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`.
      - `max_tokens` integer, nullable — The maximum number of [tokens](/tokenizer) that can be generated in the chat completion. This value can be used to control [costs](https://openai.com/api/pricing/) for text generated via API. This value is now deprecated in favor of `max_completion_tokens`, and is not compatible with [o-series models](/docs/guides/reasoning).
      - `n` integer, nullable — How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs.
      - `prediction` PredictionContent
        - `type` 'content', required — The type of the predicted content you want to provide. This type is currently always `content`.
        - `content` union, required — The content that should be matched when generating a model response. If generated tokens would match this content, the entire model response can be returned much more quickly.
          - string
          - ChatCompletionRequestMessageContentPartText[] — An array of content parts with a defined type. Supported options differ based on the [model](/docs/models) being used to generate the response. Can contain text inputs.
            - `type` 'text', required — The type of the content part.
            - `text` string, required — The text content.
      - `seed` integer, nullable — 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.
      - `stream_options` ChatCompletionStreamOptions
        - `include_usage` boolean, nullable — If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value. **NOTE:** If the stream is interrupted, you may not receive the final usage chunk which contains the total token usage for the request.
      - `tools` ChatCompletionTool[], nullable — A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported.
        - `type` 'function', required — The type of the tool. Currently, only `function` is supported.
        - `function` FunctionObject, required
          - `description` string, nullable — A description of what the function does, used by the model to choose when and how to call the function.
          - `name` string, required — The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
          - `parameters` FunctionParameters
          - `strict` boolean, nullable — Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](docs/guides/function-calling).
      - `tool_choice` union — Controls which (if any) tool is called by the model. `none` means the model will not call any tool and instead generates a message. `auto` means the model can pick between generating a message or calling one or more tools. `required` means the model must call one or more tools. Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. `none` is the default when no tools are present. `auto` is the default if tools are present.
        - 'none' | 'auto' | 'required'
        - ChatCompletionNamedToolChoice
          - `type` 'function', required — The type of the tool. Currently, only `function` is supported.
          - `function` Function3, required
            - `name` string, required — The name of the function to call.
      - `parallel_tool_calls` boolean — Whether to enable [parallel function calling](/docs/guides/function-calling#configuring-parallel-function-calling) during tool use.
      - `function_call` union — Deprecated in favor of `tool_choice`. Controls which (if any) function is called by the model. `none` means the model will not call a function and instead generates a message. `auto` means the model can pick between generating a message or calling a function. Specifying a particular function via `{"name": "my_function"}` forces the model to call that function. `none` is the default when no functions are present. `auto` is the default if functions are present.
        - 'none' | 'auto'
        - ChatCompletionFunctionCallOption
          - `name` string, required — The name of the function to call.
      - `functions` ChatCompletionFunctions[], nullable — Deprecated in favor of `tools`. A list of functions the model may generate JSON inputs for.
        - `description` string, nullable — A description of what the function does, used by the model to choose when and how to call the function.
        - `name` string, required — The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
        - `parameters` FunctionParameters
  - `model_config` BatchCompletionsModelConfig, required
    - `max_model_len` integer, nullable — Model context length, If unspecified, will be automatically derived from the model config
    - `max_num_seqs` integer, nullable — Maximum number of sequences per iteration
    - `enforce_eager` boolean, nullable — Always use eager-mode PyTorch. If False, will use eager mode and CUDA graph in hybrid for maximal perforamnce and flexibility
    - `trust_remote_code` boolean, nullable — Whether to trust remote code from Hugging face hub. This is only applicable to models whose code is not supported natively by the transformers library (e.g. deepseek). Default to False.
    - `pipeline_parallel_size` integer, nullable — Number of pipeline stages. Default to None.
    - `tensor_parallel_size` integer, nullable — Number of tensor parallel replicas. Default to None.
    - `quantization` string, nullable — Method used to quantize the weights. If None, we first check the `quantization_config` attribute in the model config file. If that is None, we assume the model weights are not quantized and use `dtype` to determine the data type of the weights.
    - `disable_log_requests` boolean, nullable — Disable logging requests. Default to None.
    - `chat_template` string, nullable — A Jinja template to use for this endpoint. If not provided, will use the chat template from the checkpoint
    - `tool_call_parser` string, nullable — Tool call parser
    - `enable_auto_tool_choice` boolean, nullable — Enable auto tool choice
    - `load_format` string, nullable — The format of the model weights to load. * "auto" will try to load the weights in the safetensors format and fall back to the pytorch bin format if safetensors format is not available. * "pt" will load the weights in the pytorch bin format. * "safetensors" will load the weights in the safetensors format. * "npcache" will load the weights in pytorch format and store a numpy cache to speed up the loading. * "dummy" will initialize the weights with random values, which is mainly for profiling. * "tensorizer" will load the weights using tensorizer from CoreWeave. See the Tensorize vLLM Model script in the Examples section for more information. * "bitsandbytes" will load the weights using bitsandbytes quantization.
    - `config_format` string, nullable — The config format which shall be loaded. Defaults to 'auto' which defaults to 'hf'.
    - `tokenizer_mode` string, nullable — Tokenizer mode. 'auto' will use the fast tokenizer ifavailable, 'slow' will always use the slow tokenizer, and'mistral' will always use the tokenizer from `mistral_common`.
    - `limit_mm_per_prompt` string, nullable — Maximum number of data instances per modality per prompt. Only applicable for multimodal models.
    - `max_num_batched_tokens` integer, nullable — Maximum number of batched tokens per iteration
    - `tokenizer` string, nullable — Name or path of the huggingface tokenizer to use.
    - `dtype` string, nullable — Data type for model weights and activations. The 'auto' option will use FP16 precision for FP32 and FP16 models, and BF16 precision for BF16 models.
    - `seed` integer, nullable — Random seed for the model.
    - `revision` string, nullable — The specific model version to use. It can be a branch name, a tag name, or a commit id. If unspecified, will use the default version.
    - `code_revision` string, nullable — The specific revision to use for the model code on Hugging Face Hub. It can be a branch name, a tag name, or a commit id. If unspecified, will use the default version.
    - `rope_scaling` object, nullable — Dictionary containing the scaling configuration for the RoPE embeddings. When using this flag, don't update `max_position_embeddings` to the expected new maximum.
    - `tokenizer_revision` string, nullable — The specific tokenizer version to use. It can be a branch name, a tag name, or a commit id. If unspecified, will use the default version.
    - `quantization_param_path` string, nullable — Path to JSON file containing scaling factors. Used to load KV cache scaling factors into the model when KV cache type is FP8_E4M3 on ROCm (AMD GPU). In the future these will also be used to load activation and weight scaling factors when the model dtype is FP8_E4M3 on ROCm.
    - `max_seq_len_to_capture` integer, nullable — Maximum sequence len covered by CUDA graphs. When a sequence has context length larger than this, we fall back to eager mode. Additionally for encoder-decoder models, if the sequence length of the encoder input is larger than this, we fall back to the eager mode.
    - `disable_sliding_window` boolean, nullable — Whether to disable sliding window. If True, we will disable the sliding window functionality of the model. If the model does not support sliding window, this argument is ignored.
    - `skip_tokenizer_init` boolean, nullable — If true, skip initialization of tokenizer and detokenizer.
    - `served_model_name` string, nullable — The model name used in metrics tag `model_name`, matches the model name exposed via the APIs. If multiple model names provided, the first name will be used. If not specified, the model name will be the same as `model`.
    - `override_neuron_config` object, nullable — Initialize non default neuron config or override default neuron config that are specific to Neuron devices, this argument will be used to configure the neuron config that can not be gathered from the vllm arguments.
    - `mm_processor_kwargs` object, nullable — Arguments to be forwarded to the model's processor for multi-modal data, e.g., image processor.
    - `block_size` integer, nullable — Size of a cache block in number of tokens.
    - `gpu_memory_utilization` number, nullable — Fraction of GPU memory to use for the vLLM execution.
    - `swap_space` number, nullable — Size of the CPU swap space per GPU (in GiB).
    - `cache_dtype` string, nullable — Data type for kv cache storage.
    - `num_gpu_blocks_override` integer, nullable — Number of GPU blocks to use. This overrides the profiled num_gpu_blocks if specified. Does nothing if None.
    - `enable_prefix_caching` boolean, nullable — Enables automatic prefix caching.
    - `model` string, required — ID of the model to use.
    - `checkpoint_path` string, nullable — Path to the checkpoint to load the model from.
    - `num_shards` integer, nullable — Suggested number of shards to distribute the model. When not specified, will infer the number of shards based on model config. System may decide to use a different number than the given value.
    - `max_context_length` integer, nullable — Maximum context length to use for the model. Defaults to the max allowed by the model. Deprecated in favor of max_model_len.
    - `response_role` string, nullable — Role of the response in the conversation. Only supported in chat completions.

## Response `200`

Successful Response

- BatchCompletionsJob
  - `job_id` string, required
  - `input_data_path` string, nullable — Path to the input file. The input file should be a JSON file of type List[CreateBatchCompletionsRequestContent].
  - `output_data_path` string, required — Path to the output file. The output file will be a JSON file of type List[CompletionOutput].
  - `model_config` BatchCompletionsModelConfig, required
    - `max_model_len` integer, nullable — Model context length, If unspecified, will be automatically derived from the model config
    - `max_num_seqs` integer, nullable — Maximum number of sequences per iteration
    - `enforce_eager` boolean, nullable — Always use eager-mode PyTorch. If False, will use eager mode and CUDA graph in hybrid for maximal perforamnce and flexibility
    - `trust_remote_code` boolean, nullable — Whether to trust remote code from Hugging face hub. This is only applicable to models whose code is not supported natively by the transformers library (e.g. deepseek). Default to False.
    - `pipeline_parallel_size` integer, nullable — Number of pipeline stages. Default to None.
    - `tensor_parallel_size` integer, nullable — Number of tensor parallel replicas. Default to None.
    - `quantization` string, nullable — Method used to quantize the weights. If None, we first check the `quantization_config` attribute in the model config file. If that is None, we assume the model weights are not quantized and use `dtype` to determine the data type of the weights.
    - `disable_log_requests` boolean, nullable — Disable logging requests. Default to None.
    - `chat_template` string, nullable — A Jinja template to use for this endpoint. If not provided, will use the chat template from the checkpoint
    - `tool_call_parser` string, nullable — Tool call parser
    - `enable_auto_tool_choice` boolean, nullable — Enable auto tool choice
    - `load_format` string, nullable — The format of the model weights to load. * "auto" will try to load the weights in the safetensors format and fall back to the pytorch bin format if safetensors format is not available. * "pt" will load the weights in the pytorch bin format. * "safetensors" will load the weights in the safetensors format. * "npcache" will load the weights in pytorch format and store a numpy cache to speed up the loading. * "dummy" will initialize the weights with random values, which is mainly for profiling. * "tensorizer" will load the weights using tensorizer from CoreWeave. See the Tensorize vLLM Model script in the Examples section for more information. * "bitsandbytes" will load the weights using bitsandbytes quantization.
    - `config_format` string, nullable — The config format which shall be loaded. Defaults to 'auto' which defaults to 'hf'.
    - `tokenizer_mode` string, nullable — Tokenizer mode. 'auto' will use the fast tokenizer ifavailable, 'slow' will always use the slow tokenizer, and'mistral' will always use the tokenizer from `mistral_common`.
    - `limit_mm_per_prompt` string, nullable — Maximum number of data instances per modality per prompt. Only applicable for multimodal models.
    - `max_num_batched_tokens` integer, nullable — Maximum number of batched tokens per iteration
    - `tokenizer` string, nullable — Name or path of the huggingface tokenizer to use.
    - `dtype` string, nullable — Data type for model weights and activations. The 'auto' option will use FP16 precision for FP32 and FP16 models, and BF16 precision for BF16 models.
    - `seed` integer, nullable — Random seed for the model.
    - `revision` string, nullable — The specific model version to use. It can be a branch name, a tag name, or a commit id. If unspecified, will use the default version.
    - `code_revision` string, nullable — The specific revision to use for the model code on Hugging Face Hub. It can be a branch name, a tag name, or a commit id. If unspecified, will use the default version.
    - `rope_scaling` object, nullable — Dictionary containing the scaling configuration for the RoPE embeddings. When using this flag, don't update `max_position_embeddings` to the expected new maximum.
    - `tokenizer_revision` string, nullable — The specific tokenizer version to use. It can be a branch name, a tag name, or a commit id. If unspecified, will use the default version.
    - `quantization_param_path` string, nullable — Path to JSON file containing scaling factors. Used to load KV cache scaling factors into the model when KV cache type is FP8_E4M3 on ROCm (AMD GPU). In the future these will also be used to load activation and weight scaling factors when the model dtype is FP8_E4M3 on ROCm.
    - `max_seq_len_to_capture` integer, nullable — Maximum sequence len covered by CUDA graphs. When a sequence has context length larger than this, we fall back to eager mode. Additionally for encoder-decoder models, if the sequence length of the encoder input is larger than this, we fall back to the eager mode.
    - `disable_sliding_window` boolean, nullable — Whether to disable sliding window. If True, we will disable the sliding window functionality of the model. If the model does not support sliding window, this argument is ignored.
    - `skip_tokenizer_init` boolean, nullable — If true, skip initialization of tokenizer and detokenizer.
    - `served_model_name` string, nullable — The model name used in metrics tag `model_name`, matches the model name exposed via the APIs. If multiple model names provided, the first name will be used. If not specified, the model name will be the same as `model`.
    - `override_neuron_config` object, nullable — Initialize non default neuron config or override default neuron config that are specific to Neuron devices, this argument will be used to configure the neuron config that can not be gathered from the vllm arguments.
    - `mm_processor_kwargs` object, nullable — Arguments to be forwarded to the model's processor for multi-modal data, e.g., image processor.
    - `block_size` integer, nullable — Size of a cache block in number of tokens.
    - `gpu_memory_utilization` number, nullable — Fraction of GPU memory to use for the vLLM execution.
    - `swap_space` number, nullable — Size of the CPU swap space per GPU (in GiB).
    - `cache_dtype` string, nullable — Data type for kv cache storage.
    - `num_gpu_blocks_override` integer, nullable — Number of GPU blocks to use. This overrides the profiled num_gpu_blocks if specified. Does nothing if None.
    - `enable_prefix_caching` boolean, nullable — Enables automatic prefix caching.
    - `model` string, required — ID of the model to use.
    - `checkpoint_path` string, nullable — Path to the checkpoint to load the model from.
    - `num_shards` integer, nullable — Suggested number of shards to distribute the model. When not specified, will infer the number of shards based on model config. System may decide to use a different number than the given value.
    - `max_context_length` integer, nullable — Maximum context length to use for the model. Defaults to the max allowed by the model. Deprecated in favor of max_model_len.
    - `response_role` string, nullable — Role of the response in the conversation. Only supported in chat completions.
  - `priority` string, nullable — Priority of the batch inference job. Default to None.
  - `status` 'queued' | 'running' | 'completed' | 'failed' | 'cancelled' | 'unknown', required
  - `created_at` string, required
  - `expires_at` string, required
  - `completed_at` string, nullable, required
  - `metadata` object, nullable, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/scaleapi/apis/launch.md) · [All operations](https://skmtc.net/scaleapi/apis/launch/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/scaleapi/launch/versions/8333576dbe43/schema)
