---
title: "Create Chat Completion"
method: POST
path: "/api/v1/openai/chat/completions"
tags: ["openai"]
---

# Create Chat Completion

`POST /api/v1/openai/chat/completions`

## Request body

- ChatCompletionRequest — Corresponds to args to OpenAI `client.chat.completions.create(...)`
  - `messages` union[], required
    - union
      - ChatCompletionDeveloperMessageParam — Developer-provided instructions that the model should follow, regardless of messages sent by the user. With o1 models and newer, `developer` messages replace the previous `system` messages.
        - `content` union, required
          - string
          - ChatCompletionContentPartTextParam[]
            - `text` string, required
            - `type` 'text', required
        - `role` 'developer', required
        - `name` string
      - ChatCompletionSystemMessageParam — Developer-provided instructions that the model should follow, regardless of messages sent by the user. With o1 models and newer, use `developer` messages for this purpose instead.
        - `content` union, required
          - string
          - ChatCompletionContentPartTextParam[]
            - `text` string, required
            - `type` 'text', required
        - `role` 'system', required
        - `name` string
      - ChatCompletionUserMessageParam — Messages sent by an end user, containing prompts or additional context information.
        - `content` union, required
          - string
          - union[]
            - union
              - …
        - `role` 'user', required
        - `name` string
      - ChatCompletionAssistantMessageParam — Messages sent by the model in response to user messages.
        - `role` 'assistant', required
        - `audio` Audio — Data about a previous audio response from the model. [Learn more](https://platform.openai.com/docs/guides/audio).
          - `id` string, required
        - `content` union
          - string
          - union[]
            - union
              - …
        - `function_call` FunctionCall — Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.
          - `arguments` string, required
          - `name` string, required
        - `name` string
        - `refusal` string, nullable
        - `tool_calls` union[]
          - union
            - ChatCompletionMessageFunctionToolCallParam — A call to a function tool created by the model.
              - …
            - ChatCompletionMessageCustomToolCallParam — A call to a custom tool created by the model.
              - …
      - ChatCompletionToolMessageParam
        - `content` union, required
          - string
          - ChatCompletionContentPartTextParam[]
            - `text` string, required
            - `type` 'text', required
        - `role` 'tool', required
        - `tool_call_id` string, required
      - ChatCompletionFunctionMessageParam
        - `content` string, nullable, required
        - `name` string, required
        - `role` 'function', required
  - `model` union, required
    - string
    - 'gpt-5.4' | 'gpt-5.3-chat-latest' | 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-codex' | 'gpt-5.1-mini' | 'gpt-5.1-chat-latest' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5-2025-08-07' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano-2025-04-14' | 'o4-mini' | 'o4-mini-2025-04-16' | 'o3' | 'o3-2025-04-16' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o1' | 'o1-2024-12-17' | 'o1-preview' | 'o1-preview-2024-09-12' | 'o1-mini' | 'o1-mini-2024-09-12' | 'gpt-4o' | 'gpt-4o-2024-11-20' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-05-13' | 'gpt-4o-audio-preview' | 'gpt-4o-audio-preview-2024-10-01' | 'gpt-4o-audio-preview-2024-12-17' | 'gpt-4o-audio-preview-2025-06-03' | 'gpt-4o-mini-audio-preview' | 'gpt-4o-mini-audio-preview-2024-12-17' | 'gpt-4o-search-preview' | 'gpt-4o-mini-search-preview' | 'gpt-4o-search-preview-2025-03-11' | 'gpt-4o-mini-search-preview-2025-03-11' | 'chatgpt-4o-latest' | 'codex-mini-latest' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-0125-preview' | 'gpt-4-turbo-preview' | 'gpt-4-1106-preview' | 'gpt-4-vision-preview' | 'gpt-4' | 'gpt-4-0314' | 'gpt-4-0613' | 'gpt-4-32k' | 'gpt-4-32k-0314' | 'gpt-4-32k-0613' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-16k' | 'gpt-3.5-turbo-0301' | 'gpt-3.5-turbo-0613' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-16k-0613'
  - `audio` ChatCompletionAudioParam — Parameters for audio output. Required when audio output is requested with `modalities: ["audio"]`. [Learn more](https://platform.openai.com/docs/guides/audio).
    - `format` 'wav' | 'aac' | 'mp3' | 'flac' | 'opus' | 'pcm16', required
    - `voice` union, required
      - string
      - 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse' | 'marin' | 'cedar'
      - VoiceID — Custom voice reference.
        - `id` string, required
  - `frequency_penalty` number, nullable
  - `function_call` union
    - 'none' | 'auto'
    - ChatCompletionFunctionCallOptionParam — Specifying a particular function via `{"name": "my_function"}` forces the model to call that function.
      - `name` string, required
  - `functions` OpenaiTypesChatCompletionCreateParamsFunction[], nullable
    - `name` string, required
    - `description` string
    - `parameters` object
  - `logit_bias` object, nullable
  - `logprobs` boolean, nullable
  - `max_completion_tokens` integer, nullable
  - `max_tokens` integer, nullable
  - `metadata` object, nullable
  - `modalities` string[], nullable
  - `n` integer, nullable
  - `parallel_tool_calls` boolean, nullable
  - `prediction` ChatCompletionPredictionContentParam — Static predicted output content, such as the content of a text file that is being regenerated.
    - `content` union, required
      - string
      - ChatCompletionContentPartTextParam[]
        - `text` string, required
        - `type` 'text', required
    - `type` 'content', required
  - `presence_penalty` number, nullable
  - `reasoning_effort` 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh', nullable
  - `response_format` union
    - ResponseFormatText — Default response format. Used to generate text responses.
      - `type` 'text', required
    - ResponseFormatJSONSchema — JSON Schema response format. Used to generate structured JSON responses. Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).
      - `json_schema` JSONSchema, required — Structured Outputs configuration options, including a JSON Schema.
        - `name` string, required
        - `description` string
        - `schema` object
        - `strict` boolean, nullable
      - `type` 'json_schema', required
    - ResponseFormatJSONObject — JSON object response format. An older method of generating JSON responses. Using `json_schema` is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.
      - `type` 'json_object', required
  - `seed` integer, nullable
  - `service_tier` 'auto' | 'default' | 'flex' | 'scale' | 'priority', nullable
  - `stop` union
    - string
    - string[]
  - `store` boolean, nullable
  - `stream` boolean, nullable
  - `stream_options` ChatCompletionStreamOptionsParam — Options for streaming response. Only set this when you set `stream: true`.
    - `include_obfuscation` boolean
    - `include_usage` boolean
  - `temperature` number, nullable
  - `tool_choice` union
    - 'none' | 'auto' | 'required'
    - ChatCompletionAllowedToolChoiceParam — Constrains the tools available to the model to a pre-defined set.
      - `allowed_tools` ChatCompletionAllowedToolsParam, required — Constrains the tools available to the model to a pre-defined set.
        - `mode` 'auto' | 'required', required
        - `tools` object[], required
      - `type` 'allowed_tools', required
    - ChatCompletionNamedToolChoiceParam — Specifies a tool the model should use. Use to force the model to call a specific function.
      - `function` OpenaiTypesChatChatCompletionNamedToolChoiceParamFunction, required
        - `name` string, required
      - `type` 'function', required
    - ChatCompletionNamedToolChoiceCustomParam — Specifies a tool the model should use. Use to force the model to call a specific custom tool.
      - `custom` OpenaiTypesChatChatCompletionNamedToolChoiceCustomParamCustom, required
        - `name` string, required
      - `type` 'custom', required
  - `tools` ChatCompletionFunctionToolParam[], nullable
    - `function` FunctionDefinition, required
      - `name` string, required
      - `description` string
      - `parameters` object
      - `strict` boolean, nullable
    - `type` 'function', required
  - `top_logprobs` integer, nullable
  - `top_p` number, nullable
  - `user` string, nullable
  - `web_search_options` WebSearchOptions — This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search?api-mode=chat).
    - `search_context_size` 'low' | 'medium' | 'high'
    - `user_location` WebSearchOptionsUserLocation — Approximate location parameters for the search.
      - `approximate` WebSearchOptionsUserLocationApproximate, required — Approximate location parameters for the search.
        - `city` string
        - `country` string
        - `region` string
        - `timezone` string
      - `type` 'approximate', required

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/kagenti/apis/adk-server.md) · [All operations](https://skmtc.net/kagenti/apis/adk-server/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kagenti/adk-server/revisions/9c0d1a763cc6/schema)
