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

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "http://localhost:8080/litellm/cohere/v2/chat" \  -H "Content-Type: application/json" \  -d '{    "model": "command-r-plus",    "messages": [      {        "role": "system"      }    ]  }'
{
  "id": "string",
  "finish_reason": "COMPLETE",
  "message": {
    "role": "string",
    "content": [
      {
        "type": "text",
        "text": "string",
        "image_url": {
          "url": "string"
        },
        "thinking": "string",
        "document": {
          "data": {},
          "id": "string"
        }
      }
    ],
    "tool_calls": [
      {
        "id": "string",
        "type": "function",
        "function": {
          "name": "string",
          "arguments": "string"
        }
      }
    ],
    "tool_plan": "string"
  },
  "usage": {
    "billed_units": {
      "input_tokens": 0,
      "output_tokens": 0,
      "search_units": 0,
      "classifications": 0
    },
    "tokens": {
      "input_tokens": 0,
      "output_tokens": 0
    },
    "cached_tokens": 0
  },
  "logprobs": [
    {
      "token_ids": [
        0
      ],
      "text": "string",
      "logprobs": [
        0
      ]
    }
  ]
}
{
  "type": "string",
  "message": "string",
  "code": "string"
}
{
  "type": "string",
  "message": "string",
  "code": "string"
}