API Reference
Chat Completions
Creates a model response for the given conversation. Fully compatible with OpenAI's /v1/chat/completions endpoint.
Endpoint
POST /v1/chat/completionsBase URLs
- Local:
http://localhost:11435 - Mesh:
https://api.tarx.com - Enterprise:
https://tarx.your-company.com
Request body
| Parameter | Type | Description |
|---|---|---|
model* | string | Model ID. Use "tarx-qwen2.5-7b" for local. |
messages* | array | Array of message objects with role and content. |
stream | boolean | If true, returns Server-Sent Events. Default: false. |
max_tokens | integer | Maximum tokens to generate. Default: 1024. |
temperature | number | Sampling temperature 0–2. Default: 0.7. |
Example
response = client.chat.completions.create(
model="tarx-qwen2.5-7b",
messages=[
{"role": "system", "content": "You are helpful."},
{"role": "user", "content": "Summarize this code..."}
],
stream=True,
max_tokens=1024
)