> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pipellm.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Chat Completions

> Send a chat completion through PipeLLM.

The default chat path is OpenAI Chat Completions:

```
POST https://api.pipellm.ai/v1/chat/completions
```

<CodeGroup>
  ```python Python theme={"dark"}
  import os
  from openai import OpenAI

  client = OpenAI(
      api_key=os.environ["PIPELLM_API_KEY"],
      base_url="https://api.pipellm.ai/v1",
  )

  response = client.chat.completions.create(
      model="gpt-5",
      messages=[
          {"role": "system", "content": "You are a helpful assistant."},
          {"role": "user", "content": "Explain rate limits in one sentence."},
      ],
  )
  print(response.choices[0].message.content)
  ```

  ```typescript TypeScript theme={"dark"}
  import OpenAI from "openai";

  const client = new OpenAI({
    apiKey: process.env.PIPELLM_API_KEY,
    baseURL: "https://api.pipellm.ai/v1",
  });

  const response = await client.chat.completions.create({
    model: "gpt-5",
    messages: [
      { role: "system", content: "You are a helpful assistant." },
      { role: "user", content: "Explain rate limits in one sentence." },
    ],
  });
  console.log(response.choices[0].message.content);
  ```

  ```bash cURL theme={"dark"}
  curl https://api.pipellm.ai/v1/chat/completions \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer $PIPELLM_API_KEY" \
    -d '{
      "model": "gpt-5",
      "messages": [
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Explain rate limits in one sentence."}
      ]
    }'
  ```
</CodeGroup>

Pick `model` from [`GET /v1/models`](/api-reference/list-models). Native `/v1/chat/completions` only routes to OpenAI-compatible platforms. To keep this request shape while calling Claude or Gemini, use the [OpenAI converter](/converter/openai-format).

## Related

<Columns cols={2}>
  <Card title="Streaming" href="/guides/streaming">
    Set `stream: true` and read SSE chunks.
  </Card>

  <Card title="Chat Completions API" href="/api-reference/openai/chat-completions">
    Parameters, function calling, and response fields.
  </Card>

  <Card title="Responses API" href="/api-reference/openai/responses">
    OpenAI Responses on PipeLLM.
  </Card>

  <Card title="Routing" href="/guides/routing-protocols">
    Native routes versus converter routes.
  </Card>
</Columns>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.