{
  "openapi": "3.1.0",
  "info": {
    "title": "Prodia integration planning",
    "version": "1.0.0",
    "description": "Reference estimates and request templates for curated Prodia presets. This is not the inference API: no jobs, accounts or charges are created. Inference is documented at https://docs.prodia.com/reference/inference/."
  },
  "servers": [
    {
      "url": "https://prodia.com"
    }
  ],
  "paths": {
    "/api/agent-plan": {
      "post": {
        "operationId": "prepareProdiaIntegrationPlan",
        "summary": "Prepare a plan without running inference",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "model": {
                    "type": "string",
                    "enum": [
                      "h3-fast",
                      "klein-4b"
                    ],
                    "description": "A curated preset ID with fixed output settings. See /agent-catalog.json."
                  },
                  "quantity": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1000000,
                    "description": "Planned output count. Does not execute a batch."
                  },
                  "budget_usd": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1000000,
                    "description": "Planning budget only; not an enforced spend limit."
                  },
                  "prompt": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 2000,
                    "description": "An example generation prompt. Do not include credentials."
                  }
                },
                "required": [
                  "model",
                  "quantity",
                  "budget_usd",
                  "prompt"
                ]
              },
              "example": {
                "model": "h3-fast",
                "quantity": 1000,
                "budget_usd": 300,
                "prompt": "An aerial camera drifts over an alpine ridge at sunrise, clouds rolling through the valley."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reference plan. No execution and no spend enforcement.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "mode",
                    "execution_performed",
                    "model",
                    "estimate",
                    "request",
                    "handoff",
                    "sources"
                  ],
                  "properties": {
                    "schema_version": {
                      "const": "1.0"
                    },
                    "mode": {
                      "const": "planning_only"
                    },
                    "execution_performed": {
                      "const": false
                    },
                    "model": {
                      "type": "object"
                    },
                    "estimate": {
                      "type": "object",
                      "properties": {
                        "total_usd": {
                          "type": "number"
                        },
                        "budget_status": {
                          "enum": [
                            "within_reference_budget",
                            "over_reference_budget"
                          ]
                        },
                        "observed_on": {
                          "type": "string",
                          "format": "date"
                        },
                        "live_quote": {
                          "const": false
                        }
                      }
                    },
                    "request": {
                      "type": "object",
                      "description": "One request template for https://inference.prodia.com/v2/job. Running it requires a Prodia token and is billable."
                    },
                    "handoff": {
                      "type": "object"
                    },
                    "integration_notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "sources": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "Error": {
        "description": "Invalid JSON, invalid fields, wrong method, body over 16 KiB or wrong content type.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}
