---
title: "Chat with model (LiteLLM - Cohere format)"
method: POST
path: "/litellm/cohere/v2/chat"
tags: ["LiteLLM Integration"]
---

# Chat with model (LiteLLM - Cohere format)

`POST /litellm/cohere/v2/chat`

Sends a chat request using Cohere-compatible format via LiteLLM.

## Request body

- CohereChatRequest
  - `model` string, required — Model to use for chat completion
  - `messages` CohereMessage[], required — Array of message objects
    - `role` 'system' | 'user' | 'assistant' | 'tool', required
    - `content` union — Message content - can be a string or array of content blocks
      - string
      - object[]
        - `type` 'text' | 'image_url' | 'thinking' | 'document', required
        - `text` string
        - `image_url` object
          - `url` string
        - `thinking` string
        - `document` object
          - `data` object
          - `id` string
    - `tool_calls` object[]
      - `id` string
      - `type` 'function'
      - `function` object
        - `name` string
        - `arguments` string
    - `tool_call_id` string
    - `tool_plan` string — Chain-of-thought style reflection (assistant only)
  - `tools` object[]
    - `type` 'function'
    - `function` object
      - `name` string
      - `description` string
      - `parameters` object
  - `tool_choice` 'AUTO' | 'NONE' | 'REQUIRED' — Tool choice mode - AUTO lets the model decide, NONE disables tools, REQUIRED forces tool use
  - `temperature` number
  - `p` number — Top-p sampling
  - `k` integer — Top-k sampling
  - `max_tokens` integer
  - `stop_sequences` string[]
  - `frequency_penalty` number
  - `presence_penalty` number
  - `stream` boolean
  - `safety_mode` 'CONTEXTUAL' | 'STRICT' | 'NONE'
  - `log_probs` boolean
  - `strict_tool_choice` boolean
  - `thinking` object
    - `type` 'enabled' | 'disabled'
    - `token_budget` integer
  - `response_format` object
    - `type` 'text' | 'json_object' — Response format type
    - `schema` object — JSON schema for structured output (used with json_object type)

## Response `200`

Successful response

- CohereChatResponse
  - `id` string
  - `finish_reason` 'COMPLETE' | 'STOP_SEQUENCE' | 'MAX_TOKENS' | 'TOOL_CALL' | 'ERROR' | 'TIMEOUT'
  - `message` object
    - `role` string
    - `content` object[]
      - `type` 'text' | 'image_url' | 'thinking' | 'document', required
      - `text` string
      - `image_url` object
        - `url` string
      - `thinking` string
      - `document` object
        - `data` object
        - `id` string
    - `tool_calls` object[]
      - `id` string
      - `type` 'function'
      - `function` object
        - `name` string
        - `arguments` string
    - `tool_plan` string
  - `usage` object
    - `billed_units` object
      - `input_tokens` integer — Number of billed input tokens
      - `output_tokens` integer — Number of billed output tokens
      - `search_units` integer — Number of billed search units
      - `classifications` integer — Number of billed classification units
    - `tokens` object
      - `input_tokens` integer — Number of input tokens used
      - `output_tokens` integer — Number of output tokens produced
    - `cached_tokens` integer — Cached tokens
  - `logprobs` object[] — Log probabilities (if requested)
    - `token_ids` integer[] — Token IDs of each token in text chunk
    - `text` string — Text chunk for log probabilities
    - `logprobs` number[] — Log probability of each token

## Other responses

- `400` — Bad request
- `500` — Internal server error

---

[API](https://skmtc.net/getbifrost/apis/bifrost-api.md) · [All operations](https://skmtc.net/getbifrost/apis/bifrost-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getbifrost/bifrost-api/versions/f8cab88f64ea/schema)
