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. Use i14-sugarglider-nemotron3-super-120B-v1. Any other ID returns 403 with the error code model_not_allowed.

messagesarrayRequired

An array of message objects representing the conversation history. Each object must contain a role and content field.

  • role (string): The author of the message. One of "system", "user", or "assistant".
  • 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. Default: 100 - if you omit this field, generation stops after 100 tokens with finish_reason set to "length".

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

A unique identifier for this completion, prefixed with req_.

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 array contains 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

The generated text content of the assistant’s reply. It is empty if the model used the whole max_tokens budget on thinking.

message.reasoning_contentstring

The thinking text the model produced before its answer.

finish_reasonstring

The reason generation stopped. Possible values:

  • "stop" - the model hit a natural stopping point or a stop sequence
  • "length" - the max_tokens limit was reached
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

i14-specific performance metrics for the request, 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.