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

# POST /v1/chat/completions: OpenAI-compatible chat inference

> Send a chat completion request through the Aria Compute ROUTER. Supports streaming SSE, tool calls, and standard OpenAI parameters.

Send chat completion requests to the Aria Compute ROUTER using the standard OpenAI API shape. The router matches the `model` field to a configured entrypoint, then routes the request through the semantic or agent engine.

## Endpoint

**POST** `/v1/chat/completions`

Data plane endpoint. Authenticate with `Authorization: Bearer <router-key>`.

## Request body

<ParamField body="model" type="string" required>
  The entrypoint name to route through (for example, `ariacompute/semantic-auto`). Must match a configured entrypoint.
</ParamField>

<ParamField body="messages" type="array" required>
  Array of message objects with `role` and `content` fields, following the OpenAI chat format.
</ParamField>

<ParamField body="stream" default="false" type="boolean">
  If `true`, the response is streamed as server-sent events (SSE).
</ParamField>

<ParamField body="temperature" type="number">
  Sampling temperature between 0 and 2.
</ParamField>

<ParamField body="max_tokens" type="integer">
  Maximum number of tokens to generate.
</ParamField>

<ParamField body="tools" type="array">
  Array of tool definitions for function calling.
</ParamField>

## Response

<ResponseField name="choices" type="array">
  Generated completion choices. Exact shape follows the standard OpenAI chat completions format.
</ResponseField>

## Example (non-streaming)

```bash theme={null}
curl -H 'Authorization: Bearer $ARIA_ROUTER_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "ariacompute/semantic-auto",
    "messages": [{"role": "user", "content": "Hello"}],
    "temperature": 0.7
  }' \
  http://<router-host>:8080/v1/chat/completions
```

```json theme={null}
{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "created": 1710000000,
  "model": "ariacompute/semantic-auto",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! How can I help you today?"
      },
      "finish_reason": "stop"
    }
  ]
}
```

## Example (streaming)

```bash theme={null}
curl -H 'Authorization: Bearer $ARIA_ROUTER_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "ariacompute/semantic-auto",
    "messages": [{"role": "user", "content": "Hello"}],
    "stream": true
  }' \
  http://<router-host>:8080/v1/chat/completions
```

```text theme={null}
data: {"id":"chatcmpl-...","object":"chat.completion.chunk", ... }

data: [DONE]
```


## Related topics

- [Aria Compute ROUTER: OpenAI-compatible inference gateway](/api-reference/router/introduction.md)
- [aria-engine runtime and FFI](/sdks/engine-runtime.md)
- [Authenticate with Aria Compute ROUTER](/api-reference/router/authentication.md)
- [Router Management Chat and Route Test API](/api-reference/router/management/chat.md)
- [Create Agent - POST /v1/agents](/api-reference/agent/agents/create.md)
