# Chat Completions

> POST /v1/chat/completions — the base OpenAI chat format.

`POST /v1/chat/completions` is the OpenAI Chat Completions format. Most SDKs
and tools speak it, and providers support it more often than any other.

## Request

```bash [curl]
curl https://ai-seller.vibe-codes.ru/v1/chat/completions \
  -H "Authorization: Bearer $AISELLER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.6-sol",
    "messages": [
      {"role": "system", "content": "Answer briefly."},
      {"role": "user", "content": "How many planets are in the Solar System?"}
    ],
    "max_tokens": 200
  }'
```

```python [Python]
from openai import OpenAI

client = OpenAI(base_url="https://ai-seller.vibe-codes.ru/v1", api_key="$AISELLER_API_KEY")
resp = client.chat.completions.create(
    model="gpt-5.6-sol",
    messages=[
        {"role": "system", "content": "Answer briefly."},
        {"role": "user", "content": "How many planets are in the Solar System?"},
    ],
    max_tokens=200,
)
print(resp.choices[0].message.content)
```

## Response

```json
{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "created": 1790000000,
  "model": "gpt-5.6-sol",
  "choices": [
    {
      "index": 0,
      "message": {"role": "assistant", "content": "Eight."},
      "finish_reason": "stop"
    }
  ],
  "usage": {"prompt_tokens": 24, "completion_tokens": 2, "total_tokens": 26}
}
```

## Specifics

- **Streaming** — `"stream": true`. Usage arrives in the last chunk only when
  requested: `"stream_options": {"include_usage": true}`. See [Streaming](https://ai-seller.vibe-codes.ru/en/docs/streaming).
- **Image input** — via `image_url` message parts (a link or a `data:` URL).
  The request body limit is 25 MiB.
- **Tools** — only your own functions (`function`, `custom`); the provider's
  built-in tools are stripped.
- **Not supported:** audio input and output and files by `file_id` — such a
  request gets `400 unsupported_parameter`.

The full parameter list is in [Request parameters](https://ai-seller.vibe-codes.ru/en/docs/params).
