BlazeInferDocs

Chat completions

Send a conversation to a BlazeInfer model and read the reply.

Chat completions are the core of the API. You send a list of messages and get one assistant reply.

POST https://blaze.e2enetworks.net/v1/chat/completions

Messages and roles

Each message has a role and content. The usual roles are:

  • system — instructions that set the model's behaviour.
  • user — input from your application.
  • assistant — earlier replies (send these back to keep context).
  • tool — the result of a tool call (see Tool calling).

qwen/qwen3.8-27b rejects the developer role, so use system for instructions.

curl https://blaze.e2enetworks.net/v1/chat/completions \
  -H "Authorization: Bearer $BLAZE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen/qwen3.8-27b",
    "messages": [
      {"role": "system", "content": "You are a concise assistant."},
      {"role": "user", "content": "Summarise HTTP caching in two sentences."}
    ],
    "max_tokens": 256
  }'

Common parameters

ParameterMeaning
modelA model ID or alias from console
messagesThe conversation so far
max_tokensCap on the reply length, including any reasoning tokens. Set it explicitly
temperatureSampling randomness
top_pNucleus sampling
streamReturn Server-Sent Events instead of one body — see Streaming
tools / tool_choiceFunction calling — see Tool calling
stopStop sequences. These can also match inside the reasoning text
seedBest-effort determinism

Reasoning counts towards max_tokens. A reasoning model can return empty content with finish_reason: "length" if reasoning uses up the budget — raise max_tokens, or turn reasoning off (see Reasoning models).

Parameter support depends on the model. If a model rejects a parameter, you get 400 with the generic message "The upstream provider rejected the request." (see Errors & retries).

Response shape

The reply is a standard OpenAI chat completion: id, object, created, model, choices[] (each with message and finish_reason) and a usage block with prompt_tokens, completion_tokens and total_tokens. Responses also carry an X-Request-Id header.

When they reason, qwen/qwen3.8-27b and qwen/qwen3.5-9b start content with two newlines, so trim the text before you show it.

On this page