Documentation
Documentation

Chat completions

OpenAI-compatible requests, parameters, and usage.

Create a chat completion

Send a JSON POST request to https://api.arnict.com/v1/chat/completions with your API key. Include a public model ID and a messages array.

Node.js
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.arnict.com/v1",
  apiKey: process.env.ARNICT_API_KEY,
});

const completion = await client.chat.completions.create({
  model: "zai/glm-5.3-flash-uncensored",
  messages: [{ role: "user", content: "Say hello in one sentence." }],
  max_tokens: 256,
});

console.log(completion.choices[0].message.content);

Compatibility scope

Arnict supports the chat-completions API. Other APIs or features offered by your SDK are not automatically available. Model-specific capabilities are listed in the catalog.

Request parameters

ParameterTypeHow to use it
modelstring, requiredAn available public model ID.
messagesarray, requiredConversation messages with a role and content. Include previous turns when your application needs conversation context.
max_tokenspositive integerAn output limit within the selected model’s published maximum.
max_completion_tokenspositive integerAn alternative output-limit field. Use one output-limit field per request.
streambooleanUse true for streamed events. The default is false.
stream_optionsobjectFor streaming, use {"include_usage": true} to request token usage.
temperaturenumberA sampling setting, where supported by the selected model.
top_pnumberA sampling setting, where supported by the selected model.
stopstring or arrayStop sequences, where supported by the selected model.

Output limits vary by model. Leave room for the input and output within the model’s context window. Start with a modest output limit and increase it when your application needs longer responses.

Check optional capabilities

Tool calls, structured output, reasoning controls and image inputs depend on the model. Use the model page and validate your request with that model before relying on a feature.

Read the result

FieldMeaning
idIdentifier for the completion.
modelThe public model ID used for the request.
choicesThe generated choices. For a standard request, read choices[0].message.content.
choices[].finish_reasonWhy generation ended. For example, stop indicates completion and length indicates a limit was reached.
usageToken counts, when provided. See Pricing for how token categories affect cost.

Read X-Request-ID from the HTTP response headers when diagnosing a request. Keep the ID and status code in your application’s operational logs; avoid logging credentials or sensitive content.