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/completions

Base URLs

  • Local: http://localhost:11435
  • Mesh: https://api.tarx.com
  • Enterprise: https://tarx.your-company.com

Request body

ParameterTypeDescription
model*stringModel ID. Use "tarx-qwen2.5-7b" for local.
messages*arrayArray of message objects with role and content.
streambooleanIf true, returns Server-Sent Events. Default: false.
max_tokensintegerMaximum tokens to generate. Default: 1024.
temperaturenumberSampling 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
)