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.
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.
Endpoint
Section titled “Endpoint”POST https://api.i14.ai/v1/chat/completionsRequest Headers
Section titled “Request Headers”| Header | Required | Value |
|---|---|---|
Authorization |
Yes | Bearer YOUR_API_KEY |
Content-Type |
Yes | application/json |
Request Body Parameters
Section titled “Request Body Parameters”modelstringRequiredmessagesarrayRequiredAn 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.
temperaturenumberSampling 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_tokensintegerThe 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_tokensintegerAn alternative output token limit for Chat Completions. Send one of max_completion_tokens or max_tokens, not both.
stream_optionsobjectWith stream: true, set include_usage: true to request the final token totals. Usage may be missing if the stream is interrupted.
toolsarrayFunction definitions that a compatible model can call. The client executes the function and sends its result in a new request.
tool_choicestring or objectControl 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_kwargsobjectOn compatible reasoning models, pass enable_thinking: true to request a thinking phase. Some clients pass this extension through their SDK’s extra-body option.
nintegerThe number of generated choices. Use 1 for Sugar Glider; some deployments do not support multiple choices.
streambooleanWhen 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_pnumberNucleus 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 arrayUp 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_penaltynumberA 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_penaltynumberA 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
Example Request
Section titled “Example Request”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 }'from openai import OpenAI
client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.i14.ai/v1",)
response = client.chat.completions.create( 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,)
print(response.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://api.i14.ai/v1",});
const response = await client.chat.completions.create({ 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,});
console.log(response.choices[0].message.content);Response Fields
Section titled “Response Fields”idstringThe completion identifier. Treat it as opaque.
objectstringThe object type. Always "chat.completion".
createdintegerThe Unix timestamp (in seconds) of when the completion was created.
modelstringThe model ID that was used to generate this completion.
choicesarrayAn array of completion choice objects. The examples request one choice.
usageobjectToken consumption statistics for this request.
x_i14_perfobjectOptional i14-specific performance metrics, when present, such as tokens_per_second, generation_time_s, and time_to_first_token_s.
Example Response
Section titled “Example Response”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 }}Streaming
Section titled “Streaming”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.