Skip to content

POST /v1/chat/completions - i14 Chat Completions API

The /v1/chat/completions endpoint is the primary way to generate text with i14 models. Send a conversation as a messages array and receive the model’s response. The endpoint is fully OpenAI-compatible, so any client library that targets the OpenAI Chat API works with i14 by updating the base URL and API key.

POST https://api.i14.ai/v1/chat/completions
Header Required Value
Authorization Yes Bearer YOUR_API_KEY
Content-Type Yes application/json
modelstringRequired

The ID of the model to use for this completion. Choose an ID returned by Models. The examples use Sugar Glider. A model your key cannot use returns 403 with the error code model_not_allowed.

messagesarrayRequired

An array of message objects representing the conversation history. Each message has a role. Include text in content for ordinary messages. In a tool conversation the assistant may provide tool_calls instead of text.

  • role (string): The author of the message. Use "system", "user", or "assistant" for chat, and "tool" to return a function result where supported.
  • content (string or array): The text content of the message. Sugar Glider (i14-sugarglider-nemotron3-super-120b-v1) accepts text only. It does not support image input.
temperaturenumber

Sampling temperature between 0.0 and 2.0. Higher values produce more random output; lower values make responses more focused and deterministic. Default: 1.0

max_tokensinteger

The maximum number of tokens to generate in the completion. Thinking tokens count toward this limit, so set it high enough for both the thinking and the answer. The request will be cut off once this limit is reached. Set this explicitly. Defaults can vary with the model deployment.

max_completion_tokensinteger

An alternative output token limit for Chat Completions. Send one of max_completion_tokens or max_tokens, not both.

stream_optionsobject

With stream: true, set include_usage: true to request the final token totals. Usage may be missing if the stream is interrupted.

toolsarray

Function definitions that a compatible model can call. The client executes the function and sends its result in a new request.

tool_choicestring or object

Control whether a compatible model can call a function. Start with "auto" to let the model decide or "none" to disable calls. Forced choices depend on model and parser support.

chat_template_kwargsobject

On compatible reasoning models, pass enable_thinking: true to request a thinking phase. Some clients pass this extension through their SDK’s extra-body option.

ninteger

The number of generated choices. Use 1 for Sugar Glider; some deployments do not support multiple choices.

streamboolean

When true, the response is delivered as a stream of Server-Sent Events (SSE) rather than a single JSON object. Each event contains a partial completion delta. Default: false

top_pnumber

Nucleus sampling probability mass. The model considers only the tokens comprising the top top_p probability mass at each step. Use this or temperature, not both. Default: 1.0

stopstring or array

Up to four sequences where the model will stop generating further tokens. The returned text will not include the stop sequence itself. Pass a single string or an array of strings.

presence_penaltynumber

A value between -2.0 and 2.0. Positive values penalize tokens that have already appeared in the text, increasing the model’s likelihood to introduce new topics. Default: 0

frequency_penaltynumber

A value between -2.0 and 2.0. Positive values penalize tokens based on how frequently they have appeared so far, reducing repetitive phrasing. Default: 0

macOS and Linux (bash or zsh)
curl --request POST \
--url https://api.i14.ai/v1/chat/completions \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "i14-sugarglider-nemotron3-super-120b-v1",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Explain what a transformer model is in one sentence."
}
],
"temperature": 0.7,
"max_tokens": 2048
}'
idstring

The completion identifier. Treat it as opaque.

objectstring

The object type. Always "chat.completion".

createdinteger

The Unix timestamp (in seconds) of when the completion was created.

modelstring

The model ID that was used to generate this completion.

choicesarray

An array of completion choice objects. The examples request one choice.

Choice object properties
indexinteger

The zero-based index of this choice within the choices array.

message.rolestring

The role of the author of this message. Always "assistant" for generated completions.

message.contentstring

Generated answer text. It can be empty or null, for example when the assistant calls a function or no answer fits the token budget.

message.tool_callsarray

Function calls requested by the assistant, when supported. Each has an ID, a function name and a JSON-encoded arguments string.

message.reasoning_contentstring

Reasoning text, if the model emits it separately. Do not require this field in a client.

finish_reasonstring

The reason generation stopped. Possible values:

  • "stop" - the model hit a natural stopping point or a stop sequence
  • "length" - the output limit was reached
  • "tool_calls" - the model requested a tool call, where supported
usageobject

Token consumption statistics for this request.

Usage object properties
prompt_tokensinteger

The number of tokens in the input messages.

completion_tokensinteger

The number of tokens in the generated completion.

total_tokensinteger

The sum of prompt_tokens and completion_tokens.

completion_tokens_details.reasoning_tokensinteger

The number of completion tokens spent on reasoning.

x_i14_perfobject

Optional i14-specific performance metrics, when present, such as tokens_per_second, generation_time_s, and time_to_first_token_s.

The x_i14_perf object below is trimmed to three of its fields.

{
"id": "req_6e8933559cc247a6a38e46ef325a9f04",
"object": "chat.completion",
"created": 1791426845,
"model": "i14-sugarglider-nemotron3-super-120b-v1",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "\n\nA transformer model is a neural network architecture that uses self-attention mechanisms to process data in parallel, capturing long-range dependencies and achieving state-of-the-art performance in tasks like natural language processing and computer vision.",
"reasoning_content": "Okay, the user wants a one-sentence explanation of a transformer model..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 48,
"completion_tokens": 599,
"total_tokens": 647,
"completion_tokens_details": {
"reasoning_tokens": 557
}
},
"x_i14_perf": {
"tokens_per_second": 36.244,
"generation_time_s": 16.5268,
"time_to_first_token_s": 0.1661
}
}

Setting "stream": true in your request body switches the response from a single JSON object to a stream of Server-Sent Events (SSE). Each event delivers a partial token delta as it is generated, letting you display results to users progressively without waiting for the full completion to finish. See the Streaming guide for a complete walkthrough and code examples.