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
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | ✅ | Model ID (see LLM Models) |
messages | array | ✅ | Array of message objects (role + content) |
stream | boolean | Enable streaming (true/false) | |
temperature | float | Sampling temperature | |
top_p | float | Nucleus sampling | |
max_tokens | integer | Maximum tokens to generate |
Extra sampling parameters
The following additional sampling parameters are supported:
| Parameter | Type | Description |
|---|---|---|
use_beam_search | bool | Enables beam search over sampling. |
top_k | int | Limits sampling to top K tokens (1 to Vocabulary_size). |
min_p | float | Minimum probability relative to top token (0.0 to 1.0). |
repetition_penalty | float | Penalizes repeated tokens (from 1.0). |
length_penalty | float | Adjusts sequence length in beam search (from 0.0 to 2.0+). |
stop_token_ids | list[int] | Tokens that trigger generation end (e.g., []). |
include_stop_str_in_output | bool | Keeps stop strings in final text. |
ignore_eos | bool | Forces generation past EOS token. |
min_tokens | int | Minimum tokens to generate (0 to max_tokens). |
skip_special_tokens | bool | Removes special tokens from output. |
spaces_between_special_tokens | bool | Adds spacing between special tokens. |
truncate_prompt_tokens | int | Limits prompt length by truncating (from 1 to max_context). |
prompt_logprobs | int | Returns logprobs for prompt tokens (e.g., null). |
allowed_token_ids | list[int] | Restricts output to specific tokens (typical values: 0 to 5). |
bad_words | list[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}