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

# 01 basic chat

# Basic Chat Completion

The simplest way to use the API: send a message, get a response.

## Endpoint

```
POST https://hetty.cfosilvia.com/v1/chat/completions
```

## Request Format

```json theme={null}
{
  "messages": [
    {"role": "user", "content": "What is the capital of France?"}
  ]
}
```

## Response Format

```json theme={null}
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "The capital of France is Paris."
    },
    "finish_reason": "stop"
  }]
}
```

## Python Example

```python theme={null}
import httpx

response = httpx.post(
    "https://hetty.cfosilvia.com/v1/chat/completions",
    json={
        "messages": [{"role": "user", "content": "Hello!"}]
    },
    timeout=60.0
)
answer = response.json()["choices"][0]["message"]["content"]
print(answer)
```

## cURL Example

```bash theme={null}
curl -X POST https://hetty.cfosilvia.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"messages":[{"role":"user","content":"Hello!"}]}'
```

## Optional Parameters

| Parameter | Type | Description |
| - | - | - |
| `temperature` | float | Randomness (0.0-2.0), default 0.7 |
| `max_tokens` | int | Maximum response length |
| `stream` | bool | Enable streaming (see streaming docs) |
| `tools` | array | Function definitions (see tool calling docs) |

## See Also

* [examples/01\_basic\_chat.py](../examples/01_basic_chat.py) - Runnable example


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