v10

latestOpenAPI 3.1.0raw.githubusercontent.com2026-07-0643140398.0 KB
Messages
Messages

Validate Messages Request

Validate a chat completion request without executing it.

This endpoint performs a dry-run validation of the chat request, checking for:

  • Message structure and content validation
  • Tool definitions and tool_choice compatibility
  • Parameter ranges and combinations
  • Conversation flow and message ordering
  • Response format compatibility with other options

Returns detailed validation results including errors. Use this endpoint to validate requests before sending them to the main chat endpoint.

Notes:

  • No tokens are consumed during validation
  • All validation rules match the main /messages endpoint
  • Warnings indicate potential issues but don't prevent execution
  • Request summary provides insights into the parsed request structure
post/v1/messages/validate

Request body

modelstring required

Model identifier or alias.

streamboolean

Whether to stream the response back to the client.

containerstring nullable

Container identifier for reuse across requests.

priorityinteger nullable

Priority of the request, used for prioritizing responses.

seedinteger nullable

Random seed for reproducibility.

min_pnumber nullable

Minimum probability threshold for token selection. Tokens with probability below this value are filtered out.

top_pnumber

Nucleus sampling parameter. Only tokens with cumulative probability up to this value are considered.

temperaturenumber

Controls randomness in generation. Higher values make output more random, lower values more deterministic.

top_kinteger

Limits token selection to the top K most likely tokens at each step.

repetition_penaltynumber nullable

Penalty applied to tokens that have already appeared in the sequence to reduce repetition.

presence_penaltynumber nullable

Penalty applied based on whether a token has appeared in the text, encouraging topic diversity.

frequency_penaltynumber nullable

Penalty applied based on how frequently a token appears in the text, reducing repetitive content.

max_tokensinteger required

Maximum number of tokens to generate in the response.

stop_sequencesstring[]

Custom stop sequences that stop generation when matched.

service_tier'auto' | 'standard_only'

Service tier preference (for example, "auto" or "standard_only").

inference_geostring nullable

Geographic region hint for inference processing.

correlation_idstring nullable

Correlation ID for tracking the request across systems.

maximum_loaded_skillsinteger nullable

Optional cap for concurrently loaded skills in a conversation. When exceeded, the oldest loaded skill is evicted.

{"stackTrail":"components:schemas:ChatBody:properties:context_management:anyOf","oasType":"schema","type":"unknown","title":"Context Management","description":"Optional context management configuration","nullable":true}

Example request

{
  "max_tokens": 1000,
  "messages": [
    {
      "content": "How do you fry an egg? Choose the best method.",
      "role": "user"
    }
  ],
  "response_format": {
    "type": "text"
  },
  "stream": false,
  "system": {
    "citations": {
      "enabled": true
    },
    "text": "You are a helpful cooking assistant. Provide clear, step-by-step instructions."
  },
  "temperature": 0.7,
  "thinking": {
    "enabled": false
  },
  "tool_choice": {
    "disable_parallel_tool_use": false,
    "type": "auto"
  },
  "tools": [
    {
      "description": "A tool to fry eggs with precise temperature control",
      "input_schema": {
        "properties": {
          "temperature": {
            "description": "Temperature in degrees Celsius",
            "type": "number"
          },
          "time": {
            "description": "Time in minutes to fry the egg",
            "type": "number"
          }
        },
        "required": [
          "temperature",
          "time"
        ],
        "type": "object"
      },
      "name": "egg_fryer"
    }
  ]
}

Response

Validation completed

validboolean

Is the request valid

errorsstring[] nullable

List of validation errors if any