{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/parallel-ai/json-schema/parallel-ai-chat-completion-request-schema.json",
  "title": "ChatCompletionRequest",
  "description": "Request for the chat completions endpoint.\n\nNote that all parameters except for `model`, `stream`, and `response_format`\nare ignored.",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/parallel-ai-chat-api-beta-api-openapi.yml#/components/schemas/ChatCompletionRequest",
  "properties": {
    "model": {
      "type": "string",
      "title": "Model",
      "description": "The model to use for chat completions."
    },
    "messages": {
      "items": {
        "$ref": "#/$defs/ChatMessage"
      },
      "type": "array",
      "title": "Messages",
      "description": "The messages to use for chat completions."
    },
    "stream": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Stream",
      "description": "Whether to stream the chat completions."
    },
    "response_format": {
      "anyOf": [
        {
          "$ref": "#/$defs/openai__types__shared_params__response_format_text__ResponseFormatText"
        },
        {
          "$ref": "#/$defs/ResponseFormatJSONSchema"
        },
        {
          "$ref": "#/$defs/openai__types__shared_params__response_format_json_object__ResponseFormatJSONObject"
        },
        {
          "type": "null"
        }
      ],
      "title": "Response Format",
      "description": "The response format to use for chat completions. OpenAI compatible."
    },
    "max_tokens": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Max Tokens",
      "description": "The maximum number of tokens to generate. Unsupported."
    },
    "temperature": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Temperature",
      "description": "The temperature to use for chat completions. Unsupported."
    },
    "top_p": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Top P",
      "description": "The top p to use for chat completions. Unsupported."
    },
    "n": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "N",
      "description": "The number of chat completions to generate. Unsupported."
    },
    "presence_penalty": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Presence Penalty",
      "description": "The presence penalty to use for chat completions. Unsupported."
    },
    "frequency_penalty": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Frequency Penalty",
      "description": "The frequency penalty to use for chat completions. Unsupported."
    },
    "previous_interaction_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Previous Interaction Id",
      "description": "Interaction ID from a previous chat completion to use as context."
    }
  },
  "type": "object",
  "required": [
    "model",
    "messages"
  ],
  "$defs": {
    "ChatMessage": {
      "properties": {
        "role": {
          "type": "string",
          "enum": [
            "system",
            "user",
            "assistant"
          ],
          "title": "Role",
          "description": "The role of the chat message."
        },
        "content": {
          "type": "string",
          "title": "Content",
          "description": "The content of the chat message."
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Name",
          "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role."
        }
      },
      "type": "object",
      "required": [
        "role",
        "content"
      ],
      "title": "ChatMessage",
      "description": "Chat message for OpenAI API."
    },
    "JSONSchema": {
      "properties": {
        "name": {
          "type": "string",
          "title": "Name"
        },
        "description": {
          "type": "string",
          "title": "Description"
        },
        "schema": {
          "additionalProperties": false,
          "type": "object",
          "title": "Schema"
        },
        "strict": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Strict"
        }
      },
      "type": "object",
      "required": [
        "name"
      ],
      "title": "JSONSchema",
      "description": "Structured Outputs configuration options, including a JSON Schema."
    },
    "ResponseFormatJSONSchema": {
      "properties": {
        "json_schema": {
          "$ref": "#/$defs/JSONSchema"
        },
        "type": {
          "type": "string",
          "const": "json_schema",
          "title": "Type"
        }
      },
      "type": "object",
      "required": [
        "json_schema",
        "type"
      ],
      "title": "ResponseFormatJSONSchema",
      "description": "JSON Schema response format.\n\nUsed to generate structured JSON responses.\nLearn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)."
    },
    "openai__types__shared_params__response_format_json_object__ResponseFormatJSONObject": {
      "properties": {
        "type": {
          "type": "string",
          "const": "json_object",
          "title": "Type"
        }
      },
      "type": "object",
      "required": [
        "type"
      ],
      "title": "ResponseFormatJSONObject",
      "description": "JSON object response format.\n\nAn older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so."
    },
    "openai__types__shared_params__response_format_text__ResponseFormatText": {
      "properties": {
        "type": {
          "type": "string",
          "const": "text",
          "title": "Type"
        }
      },
      "type": "object",
      "required": [
        "type"
      ],
      "title": "ResponseFormatText",
      "description": "Default response format. Used to generate text responses."
    }
  }
}