{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ninjachat-ai/json-schema/ninjachat-ai-responses-request-schema.json",
  "title": "ResponsesRequest",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ninjachat-ai-openapi.json#/components/schemas/ResponsesRequest",
  "type": "object",
  "properties": {
    "content_filter": {
      "type": "boolean",
      "enum": [
        true
      ],
      "description": "Optional explicit acknowledgement of mandatory server-side content filtering. Only true is accepted. Filtering remains enforced when omitted; false is rejected."
    },
    "model": {
      "type": "string",
      "minLength": 1,
      "maxLength": 160
    },
    "models": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 160
      },
      "minItems": 1,
      "maxItems": 15
    },
    "input": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1
        },
        {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "message"
                    ]
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "developer",
                      "system",
                      "user",
                      "assistant"
                    ]
                  },
                  "content": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "input_text"
                                  ]
                                },
                                "text": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "type",
                                "text"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "input_image"
                                  ]
                                },
                                "image_url": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 7000000
                                },
                                "detail": {
                                  "type": "string",
                                  "enum": [
                                    "auto",
                                    "low",
                                    "high"
                                  ]
                                }
                              },
                              "required": [
                                "type",
                                "image_url"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "input_file"
                                  ]
                                },
                                "filename": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 255
                                },
                                "file_data": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 7000000
                                },
                                "file_url": {
                                  "type": "string",
                                  "maxLength": 4096,
                                  "format": "uri"
                                },
                                "media_type": {
                                  "type": "string",
                                  "enum": [
                                    "application/pdf",
                                    "text/plain",
                                    "text/markdown",
                                    "text/csv",
                                    "application/json"
                                  ]
                                }
                              },
                              "required": [
                                "type"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        },
                        "minItems": 1
                      }
                    ]
                  }
                },
                "required": [
                  "role",
                  "content"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "function_call"
                    ]
                  },
                  "call_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "arguments": {
                    "type": "string"
                  }
                },
                "required": [
                  "type",
                  "call_id",
                  "name",
                  "arguments"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "function_call_output"
                    ]
                  },
                  "call_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "output": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "input_text"
                                  ]
                                },
                                "text": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "required": [
                                "type",
                                "text"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "input_image"
                                  ]
                                },
                                "image_url": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 7000000
                                },
                                "detail": {
                                  "type": "string",
                                  "enum": [
                                    "auto",
                                    "low",
                                    "high"
                                  ]
                                }
                              },
                              "required": [
                                "type",
                                "image_url"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "input_file"
                                  ]
                                },
                                "filename": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 255
                                },
                                "file_data": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 7000000
                                },
                                "file_url": {
                                  "type": "string",
                                  "maxLength": 4096,
                                  "format": "uri"
                                },
                                "media_type": {
                                  "type": "string",
                                  "enum": [
                                    "application/pdf",
                                    "text/plain",
                                    "text/markdown",
                                    "text/csv",
                                    "application/json"
                                  ]
                                }
                              },
                              "required": [
                                "type"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        },
                        "minItems": 1
                      }
                    ]
                  }
                },
                "required": [
                  "type",
                  "call_id",
                  "output"
                ],
                "additionalProperties": false
              }
            ]
          },
          "minItems": 1
        }
      ]
    },
    "instructions": {
      "type": "string"
    },
    "max_output_tokens": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991,
      "description": "Maximum completion tokens, including reasoning where the provider counts it. Must fit the selected provider's output and context limits. Defaults to 2048 when omitted."
    },
    "temperature": {
      "type": "number",
      "minimum": 0,
      "maximum": 2
    },
    "top_p": {
      "type": "number",
      "minimum": 0,
      "maximum": 1
    },
    "stream": {
      "type": "boolean",
      "default": false
    },
    "store": {
      "type": "boolean",
      "enum": [
        false
      ],
      "default": false
    },
    "tools": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "function"
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[a-zA-Z0-9_-]+$"
          },
          "description": {
            "type": "string"
          },
          "parameters": {
            "type": "object",
            "additionalProperties": {},
            "default": {}
          },
          "strict": {
            "type": "boolean"
          }
        },
        "required": [
          "type",
          "name"
        ],
        "additionalProperties": false
      }
    },
    "tool_choice": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "none",
            "auto",
            "required"
          ]
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "function"
              ]
            },
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          "required": [
            "type",
            "name"
          ],
          "additionalProperties": false
        }
      ]
    },
    "parallel_tool_calls": {
      "type": "boolean"
    },
    "text": {
      "type": "object",
      "properties": {
        "format": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "text"
                  ]
                }
              },
              "required": [
                "type"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "json_object"
                  ]
                }
              },
              "required": [
                "type"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "json_schema"
                  ]
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "description": {
                  "type": "string"
                },
                "schema": {
                  "type": "object",
                  "additionalProperties": {}
                },
                "strict": {
                  "type": "boolean",
                  "default": true
                }
              },
              "required": [
                "type",
                "name",
                "schema"
              ],
              "additionalProperties": false
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "reasoning": {
      "$ref": "#/$defs/ChatReasoning"
    },
    "routing": {
      "$ref": "#/$defs/RoutingPolicy"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "maxLength": 512
      }
    },
    "user": {
      "type": "string",
      "maxLength": 256
    }
  },
  "required": [
    "input"
  ],
  "additionalProperties": false,
  "$defs": {
    "ChatReasoning": {
      "type": "object",
      "properties": {
        "effort": {
          "type": "string",
          "enum": [
            "none",
            "minimal",
            "low",
            "medium",
            "high",
            "xhigh"
          ]
        },
        "max_tokens": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "enabled": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "RoutingPolicy": {
      "type": "object",
      "properties": {
        "strategy": {
          "type": "string",
          "enum": [
            "balanced",
            "cost",
            "latency",
            "quality"
          ]
        },
        "providers": {
          "type": "object",
          "properties": {
            "only": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "minItems": 1,
              "maxItems": 20
            },
            "exclude": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "minItems": 1,
              "maxItems": 20
            },
            "order": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "minItems": 1,
              "maxItems": 20
            }
          },
          "additionalProperties": false
        },
        "allow_fallbacks": {
          "type": "boolean",
          "default": true
        },
        "require_parameters": {
          "type": "boolean",
          "default": true
        },
        "data_policy": {
          "type": "string",
          "enum": [
            "default",
            "no_training",
            "zero_retention"
          ],
          "default": "default"
        },
        "caching": {
          "type": "string",
          "enum": [
            "auto"
          ]
        },
        "max_cost_usd": {
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 1000
        }
      },
      "additionalProperties": false
    }
  }
}