---
title: "Chat Completions"
method: POST
path: "/v1beta/chat/completions"
tags: ["Chat API (Beta)"]
---

# Chat Completions

`POST /v1beta/chat/completions`

## Request

- Base URL: `https://api.parallel.ai`
- URL: `https://api.parallel.ai/v1beta/chat/completions`
- Auth: API key in header `x-api-key`

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.

## Request body

- ChatCompletionRequest: Request for the chat completions endpoint. Note that all parameters except for `model`, `stream`, and `response_format` are ignored.
  - `model` string, required: The model to use for chat completions.
  - `messages` ChatMessage[], required: The messages to use for chat completions.
    - `role` 'system' | 'user' | 'assistant', required: The role of the chat message.
    - `content` string, required: The content of the chat message.
    - `name` string, nullable: An optional name for the participant. Provides the model information to differentiate between participants of the same role.
  - `stream` boolean, nullable: Whether to stream the chat completions.
  - `response_format` union: The response format to use for chat completions. OpenAI compatible.
    - OpenaiTypesSharedParamsResponseFormatTextResponseFormatText: Default response format. Used to generate text responses.
      - `type` 'text', required
    - ResponseFormatJSONSchema: JSON Schema response format. Used to generate structured JSON responses. Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).
      - `json_schema` JSONSchema, required: Structured Outputs configuration options, including a JSON Schema.
        - `name` string, required
        - `description` string
        - `schema` object
        - `strict` boolean, nullable
      - `type` 'json_schema', required
    - OpenaiTypesSharedParamsResponseFormatJsonObjectResponseFormatJSONObject: JSON object response format. An older method of generating JSON responses. Using `json_schema` is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.
      - `type` 'json_object', required
  - `max_tokens` integer, nullable: The maximum number of tokens to generate. Unsupported.
  - `temperature` number, nullable: The temperature to use for chat completions. Unsupported.
  - `top_p` number, nullable: The top p to use for chat completions. Unsupported.
  - `n` integer, nullable: The number of chat completions to generate. Unsupported.
  - `presence_penalty` number, nullable: The presence penalty to use for chat completions. Unsupported.
  - `frequency_penalty` number, nullable: The frequency penalty to use for chat completions. Unsupported.
  - `previous_interaction_id` string, nullable: Interaction ID from a previous chat completion to use as context.

## Response `200`

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.

- ChatCompletion: Chat completion response.
  - `id` string, required: The id of the chat completion.
  - `choices` Choice[], required
    - `delta` ChoiceDelta, required: A chat completion delta generated by streamed model responses.
      - `content` string, nullable
      - `function_call` ChoiceDeltaFunctionCall: Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.
        - `arguments` string, nullable
        - `name` string, nullable
      - `refusal` string, nullable
      - `role` 'developer' | 'system' | 'user' | 'assistant' | 'tool', nullable
      - `tool_calls` ChoiceDeltaToolCall[], nullable
        - `index` integer, required
        - `id` string, nullable
        - `function` ChoiceDeltaToolCallFunction
          - `arguments` string, nullable
          - `name` string, nullable
        - `type` 'function', nullable
    - `finish_reason` 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call', nullable
    - `index` integer, required
    - `logprobs` ChoiceLogprobs: Log probability information for the choice.
      - `content` ChatCompletionTokenLogprob[], nullable
        - `token` string, required
        - `bytes` integer[], nullable
        - `logprob` number, required
        - `top_logprobs` TopLogprob[], required
          - `token` string, required
          - `bytes` integer[], nullable
          - `logprob` number, required
      - `refusal` ChatCompletionTokenLogprob[], nullable
        - `token` string, required
        - `bytes` integer[], nullable
        - `logprob` number, required
        - `top_logprobs` TopLogprob[], required
          - `token` string, required
          - `bytes` integer[], nullable
          - `logprob` number, required
  - `created` integer, required
  - `model` string, required
  - `object` 'chat.completion', required
  - `moderation` OpenaiTypesChatChatCompletionModeration: Moderation results for the request input and generated output, if moderated completions were requested.
    - `input` union, required
      - ModerationInputModerationResults: Successful moderation results for the request input or generated output.
        - `model` string, required
        - `results` ModerationInputModerationResultsResult[], required
          - `categories` object, required
          - `category_applied_input_types` object, required
          - `category_scores` object, required
          - `flagged` boolean, required
          - `model` string, required
          - `type` 'moderation_result', required
        - `type` 'moderation_results', required
      - OpenaiTypesChatChatCompletionModerationInputError: An error produced while attempting moderation.
        - `code` string, required
        - `message` string, required
        - `type` 'error', required
    - `output` union, required
      - ModerationOutputModerationResults: Successful moderation results for the request input or generated output.
        - `model` string, required
        - `results` ModerationOutputModerationResultsResult[], required
          - `categories` object, required
          - `category_applied_input_types` object, required
          - `category_scores` object, required
          - `flagged` boolean, required
          - `model` string, required
          - `type` 'moderation_result', required
        - `type` 'moderation_results', required
      - OpenaiTypesChatChatCompletionModerationOutputError: An error produced while attempting moderation.
        - `code` string, required
        - `message` string, required
        - `type` 'error', required
  - `service_tier` 'auto' | 'default' | 'flex' | 'scale' | 'priority', nullable
  - `system_fingerprint` string, nullable
  - `usage` CompletionUsage: Usage statistics for the completion request.
    - `completion_tokens` integer, required
    - `prompt_tokens` integer, required
    - `total_tokens` integer, required
    - `completion_tokens_details` CompletionTokensDetails: Breakdown of tokens used in a completion.
      - `accepted_prediction_tokens` integer, nullable
      - `audio_tokens` integer, nullable
      - `reasoning_tokens` integer, nullable
      - `rejected_prediction_tokens` integer, nullable
    - `prompt_tokens_details` PromptTokensDetails: Breakdown of tokens used in the prompt.
      - `audio_tokens` integer, nullable
      - `cached_tokens` integer, nullable
  - `basis` FieldBasis[]: Basis for the chat completion, including citations and reasoning supporting the output.
    - `field` string, required: Name of the output field.
    - `citations` Citation[]: List of citations supporting the output field.
      - `title` string, nullable: Title of the citation.
      - `url` string, required: URL of the citation.
      - `excerpts` string[], nullable: Excerpts from the citation supporting the output. Only certain processors provide excerpts.
    - `reasoning` string, required: Reasoning for the output field.
    - `confidence` string, nullable: Confidence level for the output field. Only certain processors provide confidence levels.
  - `interaction_id` string, nullable: Identifier for this interaction. Pass as previous_interaction_id for follow-ups.

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-16** `fc4858951ccf`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/parallel-web/apis/parallel-api/changes/v1beta/chat/completions/post.md)

---

[API](https://skmtc.dev/parallel-web/apis/parallel-api.md) - [All operations](https://skmtc.dev/parallel-web/apis/parallel-api/llms.txt) - [OpenAPI document](https://skmtc.dev/parallel-web/apis/parallel-api/revisions/eae6def9641f?raw)
