{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aiand-com/json-schema/aiand-com-create-response-request-schema.json",
  "title": "CreateResponseRequest",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aiand-com-openapi.json#/components/schemas/CreateResponseRequest",
  "type": "object",
  "properties": {
    "model": {
      "type": "string",
      "description": "ID of the model to use for this response."
    },
    "input": {
      "$ref": "#/$defs/ResponseInput",
      "description": "Text, image, or file inputs to the model. Can be a string or an array of input items."
    },
    "instructions": {
      "type": [
        "string",
        "null"
      ],
      "description": "A system (or developer) message inserted into the model's context."
    },
    "stream": {
      "type": [
        "boolean",
        "null"
      ],
      "default": false,
      "description": "If true, response data will be streamed as server-sent events."
    },
    "temperature": {
      "type": [
        "number",
        "null"
      ],
      "minimum": 0,
      "maximum": 2,
      "description": "Sampling temperature between 0 and 2. Higher values make output more random."
    },
    "top_p": {
      "type": [
        "number",
        "null"
      ],
      "exclusiveMinimum": 0,
      "maximum": 1,
      "description": "Nucleus sampling: consider tokens with top_p probability mass. Greater than 0 and at most 1."
    },
    "max_output_tokens": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Upper bound for tokens that can be generated, including visible output and reasoning tokens."
    },
    "tools": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "const": "function"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "parameters": {
            "type": "object",
            "additionalProperties": true
          },
          "strict": {
            "type": [
              "boolean",
              "null"
            ]
          }
        },
        "required": [
          "type",
          "name"
        ],
        "additionalProperties": true
      },
      "description": "An array of function tools the model may call while generating a response."
    },
    "tool_choice": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "none",
            "auto",
            "required"
          ]
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "const": "function"
            },
            "name": {
              "type": "string"
            }
          },
          "required": [
            "type",
            "name"
          ]
        }
      ],
      "description": "How the model should select which tool to use. \"none\", \"auto\", \"required\", or a specific tool."
    },
    "parallel_tool_calls": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Whether to allow the model to run tool calls in parallel."
    },
    "reasoning": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "effort": {
          "type": "string",
          "enum": [
            "none",
            "minimal",
            "low",
            "medium",
            "high",
            "xhigh",
            "max"
          ]
        },
        "summary": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "auto",
            "concise",
            "detailed",
            null
          ]
        }
      },
      "description": "Configuration for reasoning models: effort level and summary format."
    },
    "truncation": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "auto",
        "disabled",
        null
      ],
      "description": "\"auto\" truncates input to fit context window. \"disabled\" (default) returns 400 if input exceeds context."
    },
    "previous_response_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "A non-empty value is rejected with 400 unsupported_value: response objects are not stored. Send the earlier turns in `input`."
    },
    "store": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Accepted for compatibility and ignored. Response objects are not stored."
    },
    "metadata": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": "string"
      },
      "description": "Set of key-value pairs for additional information."
    },
    "text": {
      "type": "object",
      "properties": {
        "format": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "text"
                }
              },
              "required": [
                "type"
              ]
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "json_object"
                }
              },
              "required": [
                "type"
              ]
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "json_schema"
                },
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                },
                "strict": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                }
              },
              "required": [
                "type",
                "name"
              ]
            }
          ]
        }
      },
      "additionalProperties": true,
      "description": "Configuration for text response format (text, json_object, json_schema)."
    },
    "top_logprobs": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 20,
      "description": "Number of most likely tokens to return at each position (0-20)."
    },
    "seed": {
      "type": [
        "integer",
        "null"
      ],
      "description": "If specified, the system will attempt deterministic sampling."
    },
    "stop": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "maxItems": 4
        },
        {
          "type": "null"
        }
      ],
      "description": "Up to 4 sequences where the API will stop generating further tokens."
    },
    "top_k": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": -1,
      "description": "Number of highest probability tokens to keep for top-k sampling. -1 to disable."
    },
    "repetition_penalty": {
      "type": [
        "number",
        "null"
      ],
      "description": "Penalizes new tokens based on whether they appear in the generated text so far. Values > 1.0 penalize repetitions."
    },
    "min_tokens": {
      "type": "integer",
      "minimum": 0,
      "description": "Minimum number of tokens to generate before allowing a stop condition."
    }
  },
  "required": [
    "model",
    "input"
  ],
  "additionalProperties": true,
  "$defs": {
    "ResponseInput": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "role": {
                    "type": "string",
                    "enum": [
                      "user",
                      "assistant",
                      "developer",
                      "system"
                    ]
                  },
                  "content": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "input_text"
                                },
                                "text": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "type",
                                "text"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "input_image"
                                },
                                "image_url": {
                                  "type": "string"
                                },
                                "file_id": {
                                  "type": "string"
                                },
                                "detail": {
                                  "type": "string",
                                  "enum": [
                                    "auto",
                                    "low",
                                    "high"
                                  ]
                                }
                              },
                              "required": [
                                "type"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "input_file"
                                },
                                "file_id": {
                                  "type": "string"
                                },
                                "file_data": {
                                  "type": "string"
                                },
                                "filename": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          ]
                        },
                        "minItems": 1
                      }
                    ]
                  }
                },
                "required": [
                  "role",
                  "content"
                ],
                "additionalProperties": true
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "function_call"
                  },
                  "call_id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "arguments": {
                    "type": "string"
                  }
                },
                "required": [
                  "type",
                  "call_id",
                  "name",
                  "arguments"
                ],
                "additionalProperties": true
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "function_call_output"
                  },
                  "call_id": {
                    "type": "string"
                  },
                  "output": {
                    "type": "string"
                  }
                },
                "required": [
                  "type",
                  "call_id",
                  "output"
                ],
                "additionalProperties": true
              }
            ]
          },
          "minItems": 1
        }
      ],
      "description": "Text, image, or file inputs to the model. Can be a string (treated as user message) or an array of input items."
    }
  }
}