Release Notes
- What's new
- Known issues
- Troubleshooting
- License reference
Get Started
Environments
Large Language Models (LLMs)
Webchats
Tutorials
API's reference
- watsonx Orchestrate Developer Edition APIs
Legal notices
Completions
Create Chat Completion
POST
/
completions
/
chat
Copy
Ask AI
curl --request POST \
--url http://localhost/api/v1/completions/chat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "<string>",
"messages": [
{
"role": "<string>",
"content": "<string>",
"name": "<string>"
}
],
"frequency_penalty": 123,
"presence_penalty": 123,
"logit_bias": {},
"temperature": 123,
"n": 123,
"seed": 123,
"stop": [
"<string>"
],
"stream": true,
"top_p": 123,
"max_tokens": 123,
"tools": [
{
"type": "function",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {}
}
}
],
"tool_choice": "<string>",
"user": "<string>",
"extra_model_args": {}
}'
Copy
Ask AI
{
"content": "<string>",
"response_metadata": {}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
Response
200
application/json
Successful Response
The response is of type object
.
Copy
Ask AI
curl --request POST \
--url http://localhost/api/v1/completions/chat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "<string>",
"messages": [
{
"role": "<string>",
"content": "<string>",
"name": "<string>"
}
],
"frequency_penalty": 123,
"presence_penalty": 123,
"logit_bias": {},
"temperature": 123,
"n": 123,
"seed": 123,
"stop": [
"<string>"
],
"stream": true,
"top_p": 123,
"max_tokens": 123,
"tools": [
{
"type": "function",
"function": {
"name": "<string>",
"description": "<string>",
"parameters": {}
}
}
],
"tool_choice": "<string>",
"user": "<string>",
"extra_model_args": {}
}'
Copy
Ask AI
{
"content": "<string>",
"response_metadata": {}
}
Assistant
Responses are generated using AI and may contain mistakes.