Skip to main content
POST
/
v1
/
openai
/
chat
/
completions
OpenAI Chat Completion
curl --request POST \
  --url https://{customer-tenant}.nuwacom.ai/v1/openai/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "messages": [
    {
      "role": "assistant",
      "content": "<string>"
    }
  ],
  "space_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "model": "<string>",
  "temperature": 123,
  "top_p": 123,
  "agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "voiceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "taskId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "capabilities": {
    "webSearch": true,
    "knowledgeBaseSearch": true,
    "visionEnabled": true
  },
  "attachmentIds": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "briefingIds": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "contentIds": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "folderIds": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "stream": true,
  "parent_message_id": 123,
  "conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
messages
object[]
required

Ordered chat messages that make up the conversation history. Always include the user’s latest turn; prepend prior turns when you want additional context.

Minimum array length: 1
space_id
string<uuid>
required
model
string | null

Use this in the API call to specify the model to use for the completion request. Is generally the model ID from the LLM provider (e.g., "gpt-4o", "o1").

temperature
number

Sampling temperature. Higher values make responses more adventurous; lower values keep them conservative.

top_p
number

Nucleus sampling parameter. Use this instead of temperature when you want to strictly cap how much of the probability mass is considered.

agentId
string<uuid> | null

Unique ID of the agent to use for the completion request. Used to load the agent's full configuration (system prompt, knowledge sources, etc.). NB: Agent must already be created in the database and available for the space.

voiceId
string<uuid> | null

UUID of the Voice to use for the completion request. NB: Voice must already be created in the database and available for the space.

taskId
string<uuid> | null

ID of the Task to use for the completion request. Used to tie the completion back to a workflow step or scheduled job. NB: Task must already be created in the database and available for the space.

capabilities
object

Provide an object of capabilities to enable the LLM perform specific tasks better (e.g., web search, internal KB, canvas, etc.).

attachmentIds
string<uuid>[]

Array of asset IDs (files, snippets, etc.) that should be injected into the completion request as supporting context.

briefingIds
string<uuid>[]

Array of Briefing document IDs to include so the model receives the same background summary the user saw.

contentIds
string<uuid>[]

Array of Content document IDs to include in the RAG context. Used to pass relevant document IDs so their content is included as additional background information for the completion request.

folderIds
string<uuid>[]

Array of Folder IDs to include in the RAG context. When provided, the LLM will use assets/documents within these folders as additional background information for the completion request.

stream
boolean

When true the API sends partial chunks as the model generates them (ideal for typing indicators). Set to false to receive a single response payload.

parent_message_id
number | null

Internal reference to the last assistant message in the thread. Include this when you need the completion to “continue” an earlier answer.

conversation_id
string<uuid> | null

Conversation UUID tying multiple completions together. Provide it to append to an existing thread; leave empty to start fresh.

Response

200

Successful completion response (see OpenAI Completions Object)