Chat API (Beta)

Chat Completions

Changed on

Chat completions.

This endpoint can be used to get realtime chat completions. It can also be used with the Task API processors to get structured, research outputs via a chat interface.

post/v1beta/chat/completions

Request

  • Base URL
    https://api.parallel.ai
  • Auth
    API key in header x-api-key

Request body

modelstring required

The model to use for chat completions.

streamboolean nullable

Whether to stream the chat completions.

max_tokensinteger nullable

The maximum number of tokens to generate. Unsupported.

temperaturenumber nullable

The temperature to use for chat completions. Unsupported.

top_pnumber nullable

The top p to use for chat completions. Unsupported.

ninteger nullable

The number of chat completions to generate. Unsupported.

presence_penaltynumber nullable

The presence penalty to use for chat completions. Unsupported.

frequency_penaltynumber nullable

The frequency penalty to use for chat completions. Unsupported.

previous_interaction_idstring nullable

Interaction ID from a previous chat completion to use as context.

Response

Returns a ChatCompletion object for non-streaming requests (application/json), or a stream of ChatCompletionResponseChunk objects for streaming requests (text/event-stream) when stream=true is set in the request.

idstring required

The id of the chat completion.

createdinteger required
modelstring required
object'chat.completion' required
service_tier'auto' | 'default' | 'flex' | 'scale' | 'priority' nullable
system_fingerprintstring nullable
interaction_idstring nullable

Identifier for this interaction. Pass as previous_interaction_id for follow-ups.

Example response

{
  "basis": [
    {
      "confidence": "low"
    }
  ]
}

Changes