Skip to Content
API ReferenceChatSend Chat Completion Request

Send chat completion request

Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.

Request

This endpoint expects an object.

字段类型必填说明
messageslist of objectsList of messages for the conversation
providerobject or nullWhen multiple model providers are available, optionally indicate your routing preference.
pluginslist of objectsPlugins you want to enable for this request, including their settings.
userstringUnique user identifier
session_idstring<=128 characters A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters.
traceobjectMetadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations.
modelstringModel to use for completion
modelslist of objectsModels to use for completion
frequency_penaltydouble or null-2-2 Frequency penalty (-2.0 to 2.0)
logit_biasmap from strings to doubles or nullToken logit bias adjustments
logprobsboolean or nullReturn log probabilities
top_logprobsdouble or null0-20 Number of top log probabilities to return (0-20)
max_completion_tokensdouble or null>=1 Maximum tokens in completion
max_tokensdouble or null>=1 Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16.
metadatamap from strings to stringsKey-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values)
presence_penaltydouble or null-2-2 Presence penalty (-2.0 to 2.0)
reasoningobjectConfiguration options for reasoning models
response_formatobjectResponse format configuration
seedinteger or nullRandom seed for deterministic outputs
stopstring or list of strings or anyStop sequences (up to 4)
streambooleanDefaults to false Enable streaming response
stream_optionsobjectStreaming configuration options
temperaturedouble or null0-2Defaults to 1 Sampling temperature (0-2)
parallel_tool_callsboolean or null-
tool_choiceenum or objectTool choice configuration
toolslist of objectsAvailable tools for function calling
top_pdouble or null0-1Defaults to 1 Nucleus sampling parameter (0-1)
debugobjectDebug options for inspecting request transformations (streaming only)
image_configmap from strings to strings or doubles or lists of anyProvider-specific image configuration options. Keys and values vary by model/provider. See https://novapai.ai/docs/guides/overview/multimodal/image-generation  for more details.
modalitieslist of enumsOutput modalities for the response. Supported values are “text”, “image”, and “audio”.
cache_controlobjectEnable automatic prompt caching. When set, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.

Response

Successful chat completion response

字段类型必填说明
idstring-Unique completion identifier
choiceslist of objects-List of completion choices
createddouble-Unix timestamp of creation
modelstring-Model used for completion
objectenum--
system_fingerprintstring or null-System fingerprint
usageobject-Token usage statistics