{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/antfly/json-schema/antfly-post-ai-v1-generate-batch-request-schema.json",
  "title": "PostAiV1GenerateBatchRequest",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_ae-authored/antfly-openapi-generated.yml#/components/schemas/PostAiV1GenerateBatchRequest",
  "type": "object",
  "properties": {
    "mode": {
      "type": "string"
    },
    "requests": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "custom_id": {
            "type": "string"
          },
          "body": {
            "type": "object",
            "properties": {
              "model": {
                "type": "string"
              },
              "messages": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "extra_content": {
                      "type": "object"
                    },
                    "role": {
                      "type": "string"
                    },
                    "content": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "tool_calls": {
                      "type": "array",
                      "items": {}
                    },
                    "tool_call_id": {
                      "type": "string"
                    }
                  }
                }
              },
              "logprobs": {
                "type": "boolean"
              },
              "top_logprobs": {
                "type": "integer"
              },
              "max_tokens": {
                "type": "integer"
              },
              "temperature": {
                "type": "number"
              },
              "top_p": {
                "type": "integer"
              },
              "top_k": {
                "type": "integer"
              },
              "stream": {
                "type": "boolean"
              },
              "stream_options": {
                "type": "object",
                "properties": {
                  "include_usage": {
                    "type": "boolean"
                  }
                }
              },
              "chat_template_kwargs": {
                "type": "object",
                "properties": {
                  "enable_thinking": {
                    "type": "boolean"
                  }
                }
              },
              "ignore_eos": {
                "type": "boolean"
              },
              "tools": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "function": {
                      "type": "object",
                      "properties": {
                        "name": {},
                        "description": {},
                        "parameters": {},
                        "strict": {}
                      }
                    }
                  }
                }
              },
              "min_p": {
                "type": "integer"
              },
              "repetition_penalty": {
                "type": "integer"
              },
              "frequency_penalty": {
                "type": "integer"
              },
              "presence_penalty": {
                "type": "integer"
              },
              "response_format": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "json_schema": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "strict": {
                        "type": "boolean"
                      },
                      "schema": {
                        "type": "object"
                      }
                    }
                  }
                }
              },
              "grammar": {
                "type": "string"
              },
              "draft_model": {
                "type": "string"
              },
              "speculative_k": {
                "type": "integer"
              },
              "speculation_policy": {
                "type": "string"
              },
              "speculation_calibration": {
                "type": "string"
              },
              "cache_dtype": {
                "type": "string"
              },
              "cache_compaction_ratio": {
                "type": "integer"
              },
              "context_management": {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string"
                  },
                  "checkpoint": {
                    "type": "object",
                    "properties": {
                      "version": {
                        "type": "string"
                      },
                      "covered_messages": {
                        "type": "integer"
                      },
                      "covered_prefix_sha256": {
                        "type": "string"
                      },
                      "parent_checkpoint_sha256": {
                        "type": "string"
                      },
                      "memory_sha256": {
                        "type": "string"
                      },
                      "model_revision": {
                        "type": "string"
                      },
                      "tokenizer_revision": {
                        "type": "string"
                      },
                      "template_revision": {
                        "type": "string"
                      },
                      "memory": {
                        "type": "object",
                        "properties": {
                          "conversation": {},
                          "tool_evidence": {},
                          "unresolved_tool_calls": {}
                        }
                      }
                    }
                  },
                  "max_input_tokens": {
                    "type": "integer"
                  },
                  "keep_recent_turns": {
                    "type": "integer"
                  }
                }
              },
              "kv_cache": {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string"
                  },
                  "version": {
                    "type": "string"
                  }
                }
              },
              "prompt_cache_key": {
                "type": "string"
              },
              "prompt_cache": {
                "type": "boolean"
              },
              "backend": {
                "type": "string"
              },
              "mode": {
                "type": "string"
              },
              "compiled_target": {
                "type": "string"
              },
              "tool_choice": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}