---
title: "Get chat completions from a news-infused AI assistant"
method: POST
path: "/v1/openai/chat/completions"
tags: ["chat"]
---

# Get chat completions from a news-infused AI assistant

`POST /v1/openai/chat/completions`

Get the chat completions for a given user message. This endpoint follows the
OpenAI API spec. It includes a couple extra params, which include:

- **journalist_mode**: Whether to activate an auto prompt that is more keen on AP styling,
citations, and fair reporting. Setting to false, you get a vanilla LLM with the news pre
added to the system prompt. No other prompting.
- **inline_citations**: Decides how you want the bot to cite sources. It can use brackets,
or it can also include the markdown with URL automatically.
- **asknews_watermark**: Whether to include the AskNews watermark in the response.

## Request body

- CreateChatCompletionRequest
  - `model` string
  - `messages` CreateChatCompletionRequestMessage[], required
    - `role` string, required
    - `content` string, required
    - `name` string, nullable
    - `function_call` object, nullable
  - `temperature` number
  - `top_p` number
  - `n` integer
  - `stream` boolean
  - `stop` union
    - string
    - string[]
  - `max_tokens` integer
  - `presence_penalty` integer
  - `frequency_penalty` integer
  - `thread_id` string, nullable
  - `user` string, nullable
  - `inline_citations` 'numbered' | 'markdown_link' | 'none'
  - `append_references` boolean
  - `journalist_mode` boolean
  - `asknews_watermark` boolean
  - `conversational_awareness` boolean
  - `filter_params` object, nullable

## Response `200`

Chat completions for a given user message

- object
  - `id` string, required
  - `created` integer, required
  - `object` string
  - `model` string
  - `usage` object, required
    - `prompt_tokens` integer, required
    - `completion_tokens` integer, required
    - `total_tokens` integer, required
  - `choices` object[], required
    - `index` integer, required
    - `message` object, required
      - `role` string, required
      - `content` string, required
      - `name` string
      - `function_call` object
    - `finish_reason` string

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `405` — Method Not Allowed
- `422` — Unprocessable Entity
- `500` — Internal Server Error

---

[API](https://skmtc.dev/asknews/apis/asknews-api.md) · [All operations](https://skmtc.dev/asknews/apis/asknews-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/asknews/asknews-api/revisions/dd4286769887/schema)
