Skip to main content
POST
/
api
/
v1
/
chat
/
completions
Create Chat Completion
curl --request POST \
  --url https://api.intelligence.io.solutions/api/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "messages": [
    {
      "content": "<string>",
      "role": "<string>",
      "name": "<string>"
    }
  ],
  "model": "<string>",
  "frequency_penalty": 123,
  "logit_bias": {},
  "logprobs": true,
  "top_logprobs": 123,
  "max_tokens": 123,
  "max_completion_tokens": 123,
  "n": 10,
  "presence_penalty": 123,
  "response_format": {
    "type": "text",
    "json_schema": {
      "name": "<string>",
      "description": "<string>",
      "schema": {},
      "strict": true
    }
  },
  "seed": 123,
  "stop": "<string>",
  "stream": true,
  "stream_options": {
    "include_usage": true,
    "continuous_usage_stats": true
  },
  "temperature": 123,
  "top_p": 123,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "<string>",
        "description": "<string>",
        "parameters": {}
      }
    }
  ],
  "tool_choice": "<string>",
  "parallel_tool_calls": true,
  "user": "<string>",
  "best_of": 123,
  "use_beam_search": false,
  "top_k": -1,
  "min_p": 0,
  "repetition_penalty": 1,
  "length_penalty": 1,
  "stop_token_ids": [
    123
  ],
  "include_stop_str_in_output": false,
  "ignore_eos": false,
  "min_tokens": 0,
  "skip_special_tokens": true,
  "spaces_between_special_tokens": true,
  "truncate_prompt_tokens": 2,
  "prompt_logprobs": 123,
  "echo": false,
  "add_generation_prompt": true,
  "continue_final_message": false,
  "add_special_tokens": false,
  "documents": [
    {}
  ],
  "chat_template": "<string>",
  "chat_template_kwargs": {},
  "guided_json": "<string>",
  "guided_regex": "<string>",
  "guided_choice": [
    "<string>"
  ],
  "guided_grammar": "<string>",
  "guided_decoding_backend": "<string>",
  "guided_whitespace_pattern": "<string>",
  "priority": 0,
  "request_id": "<string>"
}'
"<any>"
Parameter support can differ depending on the model used to generate the response, particularly for newer reasoning models. Parameters that are only supported for reasoning models are noted below. For the current state of unsupported parameters in reasoning models, refer to the reasoning guide.

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Headers

token
string

JWT token

Authorization
string

io.net provided API Key

x-api-key
string

API key set by an SDK client

Body

application/json
messages
Messages · array
required

The conversation history

Minimum length: 1
  • ChatCompletionDeveloperMessageParam
  • ChatCompletionSystemMessageParam
  • ChatCompletionUserMessageParam
  • ChatCompletionAssistantMessageParam
  • ChatCompletionToolMessageParam
  • ChatCompletionFunctionMessageParam
  • CustomChatCompletionMessageParam
model
string
required
frequency_penalty
number | null
default:0
logit_bias
object | null
logprobs
boolean | null
default:false
top_logprobs
integer | null
max_tokens
integer | null
deprecated
max_completion_tokens
integer | null
n
integer | null
default:1
Required range: 1 <= x <= 20
presence_penalty
number | null
default:0
response_format
object | null
seed
integer | null
stop
stream
boolean | null
default:false
stream_options
object | null
temperature
number | null
default:0.7
top_p
number | null
default:1
tools
ChatCompletionToolsParam · object[] | null
tool_choice
default:none
Allowed value: "none"
parallel_tool_calls
boolean | null
default:false
user
string | null
best_of
integer | null
top_k
integer
default:-1
min_p
number
default:0
repetition_penalty
number
default:1
length_penalty
number
default:1
stop_token_ids
integer[] | null
include_stop_str_in_output
boolean
default:false
ignore_eos
boolean
default:false
min_tokens
integer
default:0
skip_special_tokens
boolean
default:true
spaces_between_special_tokens
boolean
default:true
truncate_prompt_tokens
integer | null
Required range: x >= 1
prompt_logprobs
integer | null
echo
boolean
default:false

If true, the new message will be prepended with the last message if they belong to the same role.

add_generation_prompt
boolean
default:true

If true, the generation prompt will be added to the chat template. This is a parameter used by chat template in tokenizer config of the model.

continue_final_message
boolean
default:false

If this is set, the chat will be formatted so that the final message in the chat is open-ended, without any EOS tokens. The model will continue this message rather than starting a new one. This allows you to "prefill" part of the model's response for it. Cannot be used at the same time as add_generation_prompt.

add_special_tokens
boolean
default:false

If true, special tokens (e.g. BOS) will be added to the prompt on top of what is added by the chat template. For most models, the chat template takes care of adding the special tokens so this should be set to false (as is the default).

documents
Documents · object[] | null

A list of dicts representing documents that will be accessible to the model if it is performing RAG (retrieval-augmented generation). If the template does not support RAG, this argument will have no effect. We recommend that each document should be a dict containing "title" and "text" keys.

chat_template
string | null

A Jinja template to use for this conversion. As of transformers v4.44, default chat template is no longer allowed, so you must provide a chat template if the tokenizer does not define one.

chat_template_kwargs
object | null

Additional kwargs to pass to the template renderer. Will be accessible by the chat template.

guided_json

If specified, the output will follow the JSON schema.

guided_regex
string | null

If specified, the output will follow the regex pattern.

guided_choice
string[] | null

If specified, the output will be exactly one of the choices.

guided_grammar
string | null

If specified, the output will follow the context free grammar.

guided_decoding_backend
string | null

If specified, will override the default guided decoding backend of the server for this specific request. If set, must be either 'outlines' / 'lm-format-enforcer'

guided_whitespace_pattern
string | null

If specified, will override the default whitespace pattern for guided json decoding.

priority
integer
default:0

The priority of the request (lower means earlier handling; default: 0). Any priority other than 0 will raise an error if the served model does not use priority scheduling.

request_id
string

The request_id related to this request. If the caller does not set it, a random_uuid will be generated. This id is used through out the inference process and return in response.

Response

Successful Response

The response is of type any.

I