Skip to main content

Chat Completions

Create Chat Completion

POST/v1/chat/completions

Generate a text completion.


Request

curl -X POST https://api.ig1.ai/v1/chat/completions \
-H "Authorization: Bearer $IG1AI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kimi-k26-instant",
"messages": [
{ "role": "user", "content": "Write me a nice poem about DevOps." }
]
}'

Request body

ParameterTypeRequiredDescription
modelstringModel ID (see LLM Models)
messagesarrayArray of message objects (role + content)
streambooleanEnable streaming (true/false)
temperaturefloatSampling temperature
top_pfloatNucleus sampling
max_tokensintegerMaximum tokens to generate

Extra sampling parameters

The following additional sampling parameters are supported:

ParameterTypeDescription
use_beam_searchboolEnables beam search over sampling.
top_kintLimits sampling to top K tokens (1 to Vocabulary_size).
min_pfloatMinimum probability relative to top token (0.0 to 1.0).
repetition_penaltyfloatPenalizes repeated tokens (from 1.0).
length_penaltyfloatAdjusts sequence length in beam search (from 0.0 to 2.0+).
stop_token_idslist[int]Tokens that trigger generation end (e.g., []).
include_stop_str_in_outputboolKeeps stop strings in final text.
ignore_eosboolForces generation past EOS token.
min_tokensintMinimum tokens to generate (0 to max_tokens).
skip_special_tokensboolRemoves special tokens from output.
spaces_between_special_tokensboolAdds spacing between special tokens.
truncate_prompt_tokensintLimits prompt length by truncating (from 1 to max_context).
prompt_logprobsintReturns logprobs for prompt tokens (e.g., null).
allowed_token_idslist[int]Restricts output to specific tokens (typical values: 0 to 5).
bad_wordslist[string]Prohibits specific words in output.

Response

{
"choices": [
{
"finish_reason": "stop",
"index": 0,
"logprobs": null,
"message": {
"annotations": null,
"audio": null,
"content": " **The Infinite Loop**\n\nIn the space where code meets the breathing machine ...",
"function_call": null,
"reasoning": null,
"refusal": null,
"role": "assistant",
"tool_calls": []
},
"routed_experts": null,
"stop_reason": 163586,
"token_ids": null
}
],
"created": 1780560755,
"id": "chatcmpl-82a17a861416606b",
"kv_transfer_params": null,
"model": "kimi-k26-instant",
"object": "chat.completion",
"prompt_logprobs": null,
"prompt_text": null,
"prompt_token_ids": null,
"service_tier": null,
"system_fingerprint": "vllm-0.22.0-tp8-a8ec695b",
"usage": {
"completion_tokens": 276,
"prompt_tokens": 18,
"prompt_tokens_details": null,
"total_tokens": 294
}
}

Unsupported OpenAI endpoints

warning

IG1 AI does not store any chat history or data. That is why following endpoints are not supported:

  • GET/v1/chat/completions
  • GET/v1/chat/completions/{id}
  • POST/v1/chat/completions/{id}
  • DELETE/v1/chat/completions/{id}