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": "qwen35-397b-a17b-instruct-general",
"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
{
"id": "chatcmpl-beb77eb36e222299",
"object": "chat.completion",
"created": 1773745771,
"model": "qwen35-397b-a17b-instruct-general",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "In silos deep where code once slept..."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 22,
"completion_tokens": 316,
"total_tokens": 338
}
}
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}