---
title: "Create Chat Completion"
method: POST
path: "/v1/chat/completions"
---

# Create Chat Completion

`POST /v1/chat/completions`

## Request body

- object
  - `metadata` union
    - object
    - unknown
  - `top_logprobs` integer, nullable
  - `temperature` union
    - number
    - unknown
  - `top_p` union
    - number
    - unknown
  - `top_k` union
    - number
    - unknown
  - `user` string
  - `safety_identifier` string
  - `prompt_cache_key` string
  - `cache_control` object
    - `type` 'ephemeral'
    - `ttl` string
  - `service_tier` union
    - 'auto' | 'default' | 'flex' | 'scale' | 'priority'
    - unknown
  - `messages` union[], required
    - union
      - object
        - `content` union, required
          - string
          - object[]
            - `type` 'text', required
            - `text` string, required
        - `role` 'developer', required
        - `name` string
      - object
        - `content` union, required
          - string
          - object[]
            - `type` 'text', required
            - `text` string, required
        - `role` 'system', required
        - `name` string
      - object
        - `content` union, required
          - string
          - union[]
            - union
              - …
        - `role` 'user', required
        - `name` string
      - object
        - `content` union
          - string
          - union[]
            - union
              - …
          - unknown
        - `refusal` union
          - string
          - unknown
        - `role` 'assistant', required
        - `name` string
        - `audio` union
          - object
            - `id` string, required
          - unknown
        - `tool_calls` union[]
          - union
            - object
              - …
            - object
              - …
        - `function_call` union
          - object
            - `arguments` string, required
            - `name` string, required
          - unknown
      - object
        - `role` 'tool', required
        - `content` union, required
          - string
          - object[]
            - `type` 'text', required
            - `text` string, required
        - `tool_call_id` string, required
      - object
        - `role` 'function', required
        - `content` union, required
          - string
          - unknown
        - `name` string, required
  - `model` string, required
  - `modalities` union
    - string[]
    - unknown
  - `verbosity` union
    - 'low' | 'medium' | 'high'
    - unknown
  - `reasoning_effort` union
    - 'minimal' | 'low' | 'medium' | 'high'
    - unknown
  - `reasoning_options` object
    - `budget_tokens` integer, required
  - `max_completion_tokens` integer, nullable
  - `frequency_penalty` number, nullable
  - `presence_penalty` number, nullable
  - `response_format` union
    - object
      - `type` 'text', required
    - object
      - `type` 'json_schema', required
      - `json_schema` object, required
        - `description` string
        - `name` string, required
        - `schema` object
        - `strict` union
          - boolean
          - unknown
    - object
      - `type` 'json_object', required
  - `store` boolean, nullable
  - `stream` boolean, nullable
  - `stop` union
    - string
    - string[]
  - `logit_bias` object, nullable
  - `logprobs` boolean, nullable
  - `max_tokens` integer, nullable
  - `n` integer, nullable
  - `prediction` object, nullable
    - `type` 'content', required
    - `content` union, required
      - string
      - object[]
        - `type` 'text', required
        - `text` string, required
    - `reasoning` string
  - `seed` integer, nullable
  - `stream_options` union
    - object
      - `include_usage` boolean
      - `include_obfuscation` boolean
    - unknown
  - `tools` union[]
    - union
      - object
        - `type` 'function', required
        - `function` object, required
          - `description` string
          - `name` string, required
          - `parameters` object
          - `strict` union
            - boolean
            - unknown
      - object
        - `type` 'custom', required
        - `custom` object, required
          - `name` string, required
          - `description` string
          - `format` union
            - object
              - …
            - object
              - …
  - `tool_choice` union
    - 'none' | 'auto' | 'required'
    - object
      - `type` 'allowed_tools', required
      - `allowed_tools` object, required
        - `mode` 'auto' | 'required', required
        - `tools` object[], required
    - object
      - `type` 'function', required
      - `function` object, required
        - `name` string, required
    - object
      - `type` 'custom', required
      - `custom` object, required
        - `name` string, required
  - `parallel_tool_calls` boolean
  - `function_call` union
    - 'none' | 'auto'
    - object
      - `name` string, required
  - `functions` object[]
    - `description` string
    - `name` string, required
    - `parameters` object
  - `context_editing` object
    - `enabled` boolean, required
    - `clear_tool_uses` object
      - `trigger` integer
      - `keep` integer
      - `clear_at_least` integer
      - `exclude_tools` string[]
      - `clear_tool_inputs` boolean
    - `clear_thinking` object
      - `keep` union
        - integer
        - 'all'
  - `image_generation` object
    - `aspect_ratio` string, required
    - `image_size` string, required

## Response `200`

Request accepted

---

[API](https://skmtc.net/helicone/apis/helicone-ai-gateway-api.md) · [All operations](https://skmtc.net/helicone/apis/helicone-ai-gateway-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/helicone/helicone-ai-gateway-api/versions/921a3ac63a09/schema)
