{
  "openapi": "3.1.0",
  "info": {
    "title": "Axiom control plane API",
    "version": "0.1.0",
    "description": "Versioned control-plane API. Public catalog models are candidates and are not available for generation. Card charging is not configured. The product name is a working name supplied by deployment configuration."
  },
  "servers": [{ "url": "/" }],
  "components": {
    "securitySchemes": {
      "bearerAuth": { "type": "http", "scheme": "bearer" }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": true,
        "schema": { "type": "string", "minLength": 8, "maxLength": 200 }
      }
    }
  },
  "security": [{ "bearerAuth": [] }],
  "paths": {
    "/v1/jobs": {
      "post": {
        "summary": "Create a generation job",
        "parameters": [{ "$ref": "#/components/parameters/IdempotencyKey" }],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "example": {
                "model": "flux-1-schnell",
                "version": "candidate-1",
                "input": { "prompt": "A ceramic cup on a walnut table, morning light", "width": 1024, "height": 1024 }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Accepted job, or the original job when the idempotency key is replayed." },
          "409": {
            "description": "The model is not available, pricing or billing is not configured, or the idempotency key conflicts.",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "model_not_available",
                    "message": "flux-1-schnell@candidate-1 is registered as \"candidate\" and is not available for generation. No provider was called.",
                    "request_id": "generated-per-request"
                  }
                }
              }
            }
          }
        }
      },
      "get": { "summary": "List jobs for the calling organization" }
    },
    "/v1/jobs/{id}": { "get": { "summary": "Fetch one job owned by the calling organization" } },
    "/v1/jobs/{id}/cancel": { "post": { "summary": "Cancel a queued job or request cancellation of a running job" } },
    "/v1/models": { "get": { "summary": "List visible model versions and their real status" } },
    "/v1/models/{slug}": { "get": { "summary": "Fetch one model version" } },
    "/v1/uploads": { "post": { "summary": "Upload PNG, JPEG, or WebP bytes. Remote URLs are rejected." } },
    "/v1/uploads/{id}": { "get": { "summary": "Fetch upload metadata owned by the caller" } },
    "/v1/uploads/{id}/sign": { "post": { "summary": "Create a short-lived download URL" } },
    "/v1/webhooks": {
      "get": { "summary": "List webhook endpoints without secrets" },
      "post": { "summary": "Create a webhook endpoint and return the signing secret once" }
    },
    "/v1/webhooks/{id}": { "delete": { "summary": "Disable a webhook endpoint" } },
    "/v1/credits": { "get": { "summary": "Read the prepaid balance. Card charging is not configured." } },
    "/v1/organization": { "get": { "summary": "Read the organization attached to the API key" } },
    "/health": { "get": { "summary": "Liveness", "security": [] } },
    "/ready": { "get": { "summary": "Readiness: database, migrations, and storage", "security": [] } }
  }
}
