---
title: "What is the Chat Completions API? The /v1 chat endpoint"
description: "The Chat Completions API takes a list of role-tagged messages and returns the model's reply. How the request and response work, and why so many providers copy it."
url: https://broadrouter.com/glossary/chat-completions-api/
lang: en
updated: 2026-11-16
publisher: BroadRouter (a BroadNet site); API by BroadNet Inference, https://inference.broadnet.ai
---

# Chat Completions API

Updated 2026-11-16

The Chat Completions API is OpenAI's HTTP endpoint, POST /v1/chat/completions, that takes a model name and a list of role-tagged messages and returns the model's next message. Its request and response shape became the common format that OpenAI-compatible providers and SDKs reuse.

Also called: Chat Completions, chat completions endpoint, /v1/chat/completions, chat.completions.create

Most LLM code in the wild speaks one dialect: a list of messages in, one message out. That dialect is the Chat Completions API.

## How it works

You POST JSON to `/v1/chat/completions` with a `model` and a `messages` array. Each message has a `role` (`system`, `user`, `assistant` or `tool`) and `content`. The reply holds a `choices` array; each choice carries a `message` and a [finish\_reason](https://broadrouter.com/glossary/finish-reason/) that says why generation ended, plus a `usage` block with token counts.

```bash
curl https://inference.broadnet.ai/v1/chat/completions \
  -H "Authorization: Bearer $BROADNET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"broadnet/gemma-4-26b-a4b",
       "messages":[{"role":"system","content":"Answer in one line."},
                   {"role":"user","content":"What is a token?"}]}'
```

In the OpenAI Python SDK the same call is `client.chat.completions.create(...)`. Optional fields shape the output: `max_tokens`, `temperature`, `stream`, `tools`, `response_format` and others.

The API is stateless. OpenAI’s migration guide says that in Chat Completions “conversation state must be managed manually”: your code keeps the history and sends it again each turn. OpenAI’s newer Responses API uses typed items and can carry state server-side, and OpenAI recommends it for new projects on its own platform, but says Chat Completions “remains supported”.

## Why it matters

-   **Portability.** An [OpenAI-compatible API](https://broadrouter.com/glossary/openai-compatible-api/) usually means this endpoint. Changing provider is often a new [base URL](https://broadrouter.com/glossary/base-url/), key and model name.
-   **Cost.** Because the whole history is resent, input tokens grow every turn. Trim or summarise long chats.
-   **Field drift.** Compatible providers do not all accept every OpenAI field. Unknown fields may be ignored or rejected, so test the ones you depend on.

## On BroadNet Inference

BroadNet serves chat at POST /v1/chat/completions on `https://inference.broadnet.ai/v1`, for DeepSeek V4.1 Flash, [GLM 5.3](https://broadrouter.com/models/glm-5.3/), [Qwen3.8 27B](https://broadrouter.com/models/qwen3.8-27b/) and [Gemma 4 VL 26B](https://broadrouter.com/models/gemma-4-vl-26b/). [Streaming](https://broadrouter.com/glossary/streaming/) uses `stream=true` and ends with `data: [DONE]`. Tool calling and structured output are documented for GLM 5.3 and Qwen3.8 27B only. BroadNet’s [API reference](https://inference.broadnet.ai/docs?utm_source=broadrouter&utm_medium=referral&utm_campaign=glossary-chat-completions-api&utm_content=body) does not document a Responses endpoint, so use Chat Completions. Start with the [curl quickstart](https://broadrouter.com/guides/curl-quickstart/) or the [Python SDK guide](https://broadrouter.com/guides/openai-python-sdk/).

## Common mistakes

-   Sending only the latest user message and expecting the model to remember the chat.
-   Copying OpenAI-only fields to another provider without checking its reference.

## Questions

### Is the Chat Completions API deprecated?

No. OpenAI's migration guide says "Chat Completions remains supported", while it recommends the newer Responses API for new projects on OpenAI.

### Does the Chat Completions API remember earlier messages?

No. It is stateless. OpenAI's guide says conversation state "must be managed manually", so you send the full message history with every request.

### Which endpoint does BroadNet Inference use for chat?

POST /v1/chat/completions at the base URL https://inference.broadnet.ai/v1. BroadNet does not document a Responses API endpoint.

## See also

-   [OpenAI-compatible API](https://broadrouter.com/glossary/openai-compatible-api/) (term)
-   [Base URL](https://broadrouter.com/glossary/base-url/) (term)
-   [Streaming](https://broadrouter.com/glossary/streaming/) (term)
-   [finish\_reason](https://broadrouter.com/glossary/finish-reason/) (term)
-   [Tool calling](https://broadrouter.com/glossary/tool-calling/) (term)
-   [System prompt](https://broadrouter.com/glossary/system-prompt/) (term)
-   [Image tokens](https://broadrouter.com/glossary/image-tokens/) (term)
-   [First request to BroadNet Inference with curl](https://broadrouter.com/guides/curl-quickstart/) (guide)
-   [Use the OpenAI Python SDK with BroadNet Inference](https://broadrouter.com/guides/openai-python-sdk/) (guide)
-   [Stream chat completions and handle dropped connections](https://broadrouter.com/guides/streaming-chat-completions/) (guide)
-   [Migrating off the OpenAI API: a code walkthrough in Python, Node, cURL](https://broadrouter.com/blog/migrate-from-openai-api-code-walkthrough/) (article)
-   [Switching to an OpenAI-compatible API: a migration checklist](https://broadrouter.com/blog/openai-compatible-api-migration-checklist/) (article)

Try it on your real workload. New accounts start with $5 of credit for Gemma and transcription. DeepSeek, GLM and Qwen3.8 need a top-up.

[Get started](https://inference.broadnet.ai/account/?utm_source=broadrouter&utm_medium=referral&utm_campaign=glossary-chat-completions-api&utm_content=page-cta) ·

**Sources**

-   [OpenAI API reference, create chat completion (checked 2026-11-15)](https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create)
-   [OpenAI, migrate to the Responses API (checked 2026-11-15)](https://developers.openai.com/api/docs/guides/migrate-to-responses)
-   [BroadNet Inference API reference (checked 2026-11-15)](https://inference.broadnet.ai/docs?utm_source=broadrouter&utm_medium=referral&utm_campaign=glossary-chat-completions-api&utm_content=sources)
