{
  "openapi": "3.1.0",
  "info": {
    "title": "Lucidry API",
    "version": "2026-08-01",
    "description": "Lucidry turns documents, audio and video into clean, structurally faithful, publish-ready content, and translates it without losing claim strength. Authenticate with an API key as a Bearer token. Every failure uses one error envelope, every key carries explicit scopes, and every credential is rate limited.",
    "contact": {
      "email": "support@lucidry.io",
      "url": "https://lucidry.io"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://lucidry.io/terms"
    }
  },
  "servers": [
    {
      "url": "https://lucidry.base44.app/functions",
      "description": "Base44 function host. Each operation path is the deployed function name; the full live URL is servers[0].url + path. The logical v1 path is retained in each operation x-logical-path."
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key issued in the dashboard, sent as `Authorization: Bearer lucid_live_…`."
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Missing or invalid API key",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "UNAUTHORIZED",
                        "FORBIDDEN",
                        "NOT_FOUND",
                        "VALIDATION_ERROR",
                        "BAD_REQUEST",
                        "JOB_INSTRUCTIONS_TOO_LONG",
                        "JOB_NAME_TOO_LONG",
                        "INVALID_TRANSFORM_PROFILE",
                        "SOURCE_MALWARE_DETECTED",
                        "PAYMENT_REQUIRED",
                        "FREE_TIER_CAP_EXCEEDED",
                        "WALLET_INSUFFICIENT_FUNDS",
                        "RATE_LIMITED",
                        "ACCOUNT_FLAGGED",
                        "PROVIDER_UNAVAILABLE",
                        "INTERNAL_ERROR"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "details": {
                      "type": "array",
                      "items": {}
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ]
                }
              }
            }
          }
        }
      },
      "Forbidden": {
        "description": "The key lacks the required scope",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "UNAUTHORIZED",
                        "FORBIDDEN",
                        "NOT_FOUND",
                        "VALIDATION_ERROR",
                        "BAD_REQUEST",
                        "JOB_INSTRUCTIONS_TOO_LONG",
                        "JOB_NAME_TOO_LONG",
                        "INVALID_TRANSFORM_PROFILE",
                        "SOURCE_MALWARE_DETECTED",
                        "PAYMENT_REQUIRED",
                        "FREE_TIER_CAP_EXCEEDED",
                        "WALLET_INSUFFICIENT_FUNDS",
                        "RATE_LIMITED",
                        "ACCOUNT_FLAGGED",
                        "PROVIDER_UNAVAILABLE",
                        "INTERNAL_ERROR"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "details": {
                      "type": "array",
                      "items": {}
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ]
                }
              }
            }
          }
        }
      },
      "NotFound": {
        "description": "Resource not found",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "UNAUTHORIZED",
                        "FORBIDDEN",
                        "NOT_FOUND",
                        "VALIDATION_ERROR",
                        "BAD_REQUEST",
                        "JOB_INSTRUCTIONS_TOO_LONG",
                        "JOB_NAME_TOO_LONG",
                        "INVALID_TRANSFORM_PROFILE",
                        "SOURCE_MALWARE_DETECTED",
                        "PAYMENT_REQUIRED",
                        "FREE_TIER_CAP_EXCEEDED",
                        "WALLET_INSUFFICIENT_FUNDS",
                        "RATE_LIMITED",
                        "ACCOUNT_FLAGGED",
                        "PROVIDER_UNAVAILABLE",
                        "INTERNAL_ERROR"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "details": {
                      "type": "array",
                      "items": {}
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ]
                }
              }
            }
          }
        }
      },
      "ValidationError": {
        "description": "Validation error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "UNAUTHORIZED",
                        "FORBIDDEN",
                        "NOT_FOUND",
                        "VALIDATION_ERROR",
                        "BAD_REQUEST",
                        "JOB_INSTRUCTIONS_TOO_LONG",
                        "JOB_NAME_TOO_LONG",
                        "INVALID_TRANSFORM_PROFILE",
                        "SOURCE_MALWARE_DETECTED",
                        "PAYMENT_REQUIRED",
                        "FREE_TIER_CAP_EXCEEDED",
                        "WALLET_INSUFFICIENT_FUNDS",
                        "RATE_LIMITED",
                        "ACCOUNT_FLAGGED",
                        "PROVIDER_UNAVAILABLE",
                        "INTERNAL_ERROR"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "details": {
                      "type": "array",
                      "items": {}
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ]
                }
              }
            }
          }
        }
      },
      "PaymentRequired": {
        "description": "Payment required, free allowance exhausted, or wallet balance too low",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "UNAUTHORIZED",
                        "FORBIDDEN",
                        "NOT_FOUND",
                        "VALIDATION_ERROR",
                        "BAD_REQUEST",
                        "JOB_INSTRUCTIONS_TOO_LONG",
                        "JOB_NAME_TOO_LONG",
                        "INVALID_TRANSFORM_PROFILE",
                        "SOURCE_MALWARE_DETECTED",
                        "PAYMENT_REQUIRED",
                        "FREE_TIER_CAP_EXCEEDED",
                        "WALLET_INSUFFICIENT_FUNDS",
                        "RATE_LIMITED",
                        "ACCOUNT_FLAGGED",
                        "PROVIDER_UNAVAILABLE",
                        "INTERNAL_ERROR"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "details": {
                      "type": "array",
                      "items": {}
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ]
                }
              }
            }
          }
        }
      },
      "RateLimited": {
        "description": "Rate limit exceeded, see the Retry-After header",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "UNAUTHORIZED",
                        "FORBIDDEN",
                        "NOT_FOUND",
                        "VALIDATION_ERROR",
                        "BAD_REQUEST",
                        "JOB_INSTRUCTIONS_TOO_LONG",
                        "JOB_NAME_TOO_LONG",
                        "INVALID_TRANSFORM_PROFILE",
                        "SOURCE_MALWARE_DETECTED",
                        "PAYMENT_REQUIRED",
                        "FREE_TIER_CAP_EXCEEDED",
                        "WALLET_INSUFFICIENT_FUNDS",
                        "RATE_LIMITED",
                        "ACCOUNT_FLAGGED",
                        "PROVIDER_UNAVAILABLE",
                        "INTERNAL_ERROR"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "details": {
                      "type": "array",
                      "items": {}
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ]
                }
              }
            }
          }
        }
      },
      "InternalError": {
        "description": "Unexpected server error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "UNAUTHORIZED",
                        "FORBIDDEN",
                        "NOT_FOUND",
                        "VALIDATION_ERROR",
                        "BAD_REQUEST",
                        "JOB_INSTRUCTIONS_TOO_LONG",
                        "JOB_NAME_TOO_LONG",
                        "INVALID_TRANSFORM_PROFILE",
                        "SOURCE_MALWARE_DETECTED",
                        "PAYMENT_REQUIRED",
                        "FREE_TIER_CAP_EXCEEDED",
                        "WALLET_INSUFFICIENT_FUNDS",
                        "RATE_LIMITED",
                        "ACCOUNT_FLAGGED",
                        "PROVIDER_UNAVAILABLE",
                        "INTERNAL_ERROR"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "details": {
                      "type": "array",
                      "items": {}
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "request_id"
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "paths": {
    "/v1Health": {
      "get": {
        "operationId": "get_health",
        "summary": "Service health",
        "description": "Component-level health for the refinery pipeline, translation, payments and delivery.",
        "tags": [
          "Health"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-logical-path": "/health",
        "x-base44-function": "v1Health",
        "x-base44-function-url": "https://lucidry.base44.app/functions/v1Health"
      }
    },
    "/v1Translate": {
      "post": {
        "operationId": "post_translate",
        "summary": "Translate text",
        "description": "Translates text with certainty-marker preservation, protected-span locking and cross-language validation. Returns the translation, a fidelity score and a drift summary. Billed per source word: free monthly words first, then the wallet. Requires the jobs:write scope. Invoke at https://lucidry.base44.app/functions/v1Translate.",
        "tags": [
          "Translation"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-logical-path": "/translate",
        "x-base44-function": "v1Translate",
        "x-base44-function-url": "https://lucidry.base44.app/functions/v1Translate",
        "x-required-scope": "jobs:write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Retry-safe key. Replaying the same key and body returns the original response for 24 hours.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "text",
                  "target_language"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "description": "Source text. Required."
                  },
                  "target_language": {
                    "type": "string",
                    "description": "ISO 639-1 target language. Required."
                  },
                  "source_language": {
                    "type": "string",
                    "description": "ISO 639-1 source language, or omit to auto-detect."
                  },
                  "certainty_strictness": {
                    "type": "string",
                    "description": "strict | balanced | permissive."
                  },
                  "tone_preservation": {
                    "type": "string",
                    "description": "How hard to hold the source register."
                  },
                  "glossary_id": {
                    "type": "string",
                    "description": "A translation glossary in your organization."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1CreateJob": {
      "post": {
        "operationId": "post_jobs",
        "summary": "Create a refinement job",
        "description": "Quotes, reserves funds and starts a refinement job against an uploaded source. Returns 402 with payment requirements when nothing covers the job. Requires the jobs:write scope. Invoke at https://lucidry.base44.app/functions/v1CreateJob.",
        "tags": [
          "Jobs"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-logical-path": "/jobs",
        "x-base44-function": "v1CreateJob",
        "x-base44-function-url": "https://lucidry.base44.app/functions/v1CreateJob",
        "x-required-scope": "jobs:write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Retry-safe key. Replaying the same key and body returns the original response for 24 hours.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "source_asset_id",
                  "transform_profile_id"
                ],
                "properties": {
                  "source_asset_id": {
                    "type": "string",
                    "description": "A source that passed the security scan."
                  },
                  "transform_profile_id": {
                    "type": "string",
                    "description": "Transform profile to apply."
                  },
                  "target_language": {
                    "type": "string",
                    "description": "Set to add the Translate stage to the pipeline."
                  },
                  "priority": {
                    "type": "string",
                    "description": "standard | high."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/listJobs": {
      "get": {
        "operationId": "get_jobs",
        "summary": "List jobs",
        "description": "Lists jobs for the authenticated organization, newest first. Requires the jobs:read scope. Invoke at https://lucidry.base44.app/functions/listJobs.",
        "tags": [
          "Jobs"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-logical-path": "/jobs",
        "x-base44-function": "listJobs",
        "x-base44-function-url": "https://lucidry.base44.app/functions/listJobs",
        "x-required-scope": "jobs:read"
      }
    },
    "/v1GetJob": {
      "get": {
        "operationId": "get_jobs__job_id_",
        "summary": "Get a job",
        "description": "Returns job status, current stage, progress percentage and quality disposition. Requires the jobs:read scope. Invoke at https://lucidry.base44.app/functions/v1GetJob.",
        "tags": [
          "Jobs"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-logical-path": "/jobs/{job_id}",
        "x-base44-function": "v1GetJob",
        "x-base44-function-url": "https://lucidry.base44.app/functions/v1GetJob",
        "x-required-scope": "jobs:read",
        "parameters": [
          {
            "name": "job_id",
            "in": "query",
            "required": true,
            "description": "Job identifier",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1CancelJob": {
      "post": {
        "operationId": "post_jobs__job_id__cancel",
        "summary": "Cancel a job",
        "description": "Cancels a job that has not been delivered. Unstarted work is refunded in full. Requires the jobs:write scope. Invoke at https://lucidry.base44.app/functions/v1CancelJob.",
        "tags": [
          "Jobs"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-logical-path": "/jobs/{job_id}/cancel",
        "x-base44-function": "v1CancelJob",
        "x-base44-function-url": "https://lucidry.base44.app/functions/v1CancelJob",
        "x-required-scope": "jobs:write",
        "parameters": [
          {
            "name": "job_id",
            "in": "query",
            "required": true,
            "description": "Job identifier",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1Sources": {
      "post": {
        "operationId": "post_sources",
        "summary": "Register a source asset",
        "description": "Registers an uploaded document (docx or pdf) or a Google Doc reference, and queues its security scan. Requires the jobs:write scope. Invoke at https://lucidry.base44.app/functions/v1Sources.",
        "tags": [
          "Sources"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-logical-path": "/sources",
        "x-base44-function": "v1Sources",
        "x-base44-function-url": "https://lucidry.base44.app/functions/v1Sources",
        "x-required-scope": "jobs:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "file_url",
                  "file_name",
                  "file_type"
                ],
                "properties": {
                  "file_url": {
                    "type": "string",
                    "description": "URL returned by the upload step."
                  },
                  "file_name": {
                    "type": "string",
                    "description": "Original file name."
                  },
                  "file_type": {
                    "type": "string",
                    "description": "docx | pdf | txt | url."
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "get_sources",
        "summary": "List source assets",
        "description": "Lists the uploaded source assets for the authenticated organization. Requires the jobs:read scope. Invoke at https://lucidry.base44.app/functions/v1Sources.",
        "tags": [
          "Sources"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-logical-path": "/sources",
        "x-base44-function": "v1Sources",
        "x-base44-function-url": "https://lucidry.base44.app/functions/v1Sources",
        "x-required-scope": "jobs:read"
      }
    },
    "/v1GetSource": {
      "get": {
        "operationId": "get_sources__source_id_",
        "summary": "Get a source asset",
        "description": "Returns one source asset with its security scan result and extraction estimates. Requires the jobs:read scope. Invoke at https://lucidry.base44.app/functions/v1GetSource.",
        "tags": [
          "Sources"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-logical-path": "/sources/{source_id}",
        "x-base44-function": "v1GetSource",
        "x-base44-function-url": "https://lucidry.base44.app/functions/v1GetSource",
        "x-required-scope": "jobs:read",
        "parameters": [
          {
            "name": "source_id",
            "in": "query",
            "required": true,
            "description": "Source asset identifier",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1GetArtifact": {
      "get": {
        "operationId": "get_artifacts__artifact_id_",
        "summary": "Get an artifact",
        "description": "Returns artifact metadata and a signed download URL that expires 300 seconds after issue. Requires the artifacts:read scope. Invoke at https://lucidry.base44.app/functions/v1GetArtifact.",
        "tags": [
          "Artifacts"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-logical-path": "/artifacts/{artifact_id}",
        "x-base44-function": "v1GetArtifact",
        "x-base44-function-url": "https://lucidry.base44.app/functions/v1GetArtifact",
        "x-required-scope": "artifacts:read",
        "parameters": [
          {
            "name": "artifact_id",
            "in": "query",
            "required": true,
            "description": "Artifact identifier",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1Estimate": {
      "post": {
        "operationId": "post_estimates",
        "summary": "Estimate a job price",
        "description": "Returns a customer-facing price estimate for a tier and source asset, before any job is created. Requires the jobs:read scope. Invoke at https://lucidry.base44.app/functions/v1Estimate.",
        "tags": [
          "Estimates"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-logical-path": "/estimates",
        "x-base44-function": "v1Estimate",
        "x-base44-function-url": "https://lucidry.base44.app/functions/v1Estimate",
        "x-required-scope": "jobs:read",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "tier_code"
                ],
                "properties": {
                  "tier_code": {
                    "type": "string",
                    "description": "clean | edit | write | magic."
                  },
                  "source_asset_id": {
                    "type": "string",
                    "description": "Estimate from a registered source."
                  },
                  "word_count": {
                    "type": "number",
                    "description": "Estimate from a word count instead."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1Profiles": {
      "get": {
        "operationId": "get_profiles",
        "summary": "List transform profiles",
        "description": "Lists the system and organization transform profiles available to the caller. Requires the jobs:read scope. Invoke at https://lucidry.base44.app/functions/v1Profiles.",
        "tags": [
          "Profiles"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-logical-path": "/profiles",
        "x-base44-function": "v1Profiles",
        "x-base44-function-url": "https://lucidry.base44.app/functions/v1Profiles",
        "x-required-scope": "jobs:read"
      }
    },
    "/v1Usage": {
      "get": {
        "operationId": "get_usage",
        "summary": "Usage history",
        "description": "Credit position and masked usage ledger. Customer-facing amounts only, provider cost and margin are never returned. Requires the billing:read scope. Invoke at https://lucidry.base44.app/functions/v1Usage.",
        "tags": [
          "Usage"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-logical-path": "/usage",
        "x-base44-function": "v1Usage",
        "x-base44-function-url": "https://lucidry.base44.app/functions/v1Usage",
        "x-required-scope": "billing:read"
      }
    },
    "/v1Webhooks": {
      "get": {
        "operationId": "get_webhooks",
        "summary": "List webhook endpoints",
        "description": "Lists registered webhook endpoints. Signing secrets are never returned by a read. Requires the webhooks:write scope. Invoke at https://lucidry.base44.app/functions/v1Webhooks.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-logical-path": "/webhooks",
        "x-base44-function": "v1Webhooks",
        "x-base44-function-url": "https://lucidry.base44.app/functions/v1Webhooks",
        "x-required-scope": "webhooks:write"
      },
      "post": {
        "operationId": "post_webhooks",
        "summary": "Create a webhook endpoint",
        "description": "Registers an HTTPS endpoint for job lifecycle events. The signing secret is returned exactly once. Requires the webhooks:write scope. Invoke at https://lucidry.base44.app/functions/v1Webhooks.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-logical-path": "/webhooks",
        "x-base44-function": "v1Webhooks",
        "x-base44-function-url": "https://lucidry.base44.app/functions/v1Webhooks",
        "x-required-scope": "webhooks:write",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url",
                  "events"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "HTTPS endpoint to POST signed events to."
                  },
                  "events": {
                    "type": "array",
                    "description": "job.completed, job.failed, job.needs_review, …"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete_webhooks",
        "summary": "Delete a webhook endpoint",
        "description": "Removes a registered webhook endpoint. The id is passed as a query parameter. Requires the webhooks:write scope. Invoke at https://lucidry.base44.app/functions/v1Webhooks.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-logical-path": "/webhooks",
        "x-base44-function": "v1Webhooks",
        "x-base44-function-url": "https://lucidry.base44.app/functions/v1Webhooks",
        "x-required-scope": "webhooks:write"
      }
    },
    "/v1TranslationProfiles": {
      "get": {
        "operationId": "get_translation_profiles",
        "summary": "List translation profiles",
        "description": "Lists reusable translation profiles for the organization. Requires the jobs:read scope. Invoke at https://lucidry.base44.app/functions/v1TranslationProfiles.",
        "tags": [
          "Translation"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-logical-path": "/translation/profiles",
        "x-base44-function": "v1TranslationProfiles",
        "x-base44-function-url": "https://lucidry.base44.app/functions/v1TranslationProfiles",
        "x-required-scope": "jobs:read"
      }
    },
    "/v1TranslationGlossaries": {
      "get": {
        "operationId": "get_translation_glossaries",
        "summary": "List glossaries",
        "description": "Lists translation glossaries and their term counts. Requires the jobs:read scope. Invoke at https://lucidry.base44.app/functions/v1TranslationGlossaries.",
        "tags": [
          "Translation"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-logical-path": "/translation/glossaries",
        "x-base44-function": "v1TranslationGlossaries",
        "x-base44-function-url": "https://lucidry.base44.app/functions/v1TranslationGlossaries",
        "x-required-scope": "jobs:read"
      }
    },
    "/v1TranslationDriftReport": {
      "get": {
        "operationId": "get_translation_drift-report",
        "summary": "Get a drift report",
        "description": "Returns the cross-language drift report for a translated job. Requires the jobs:read scope. Invoke at https://lucidry.base44.app/functions/v1TranslationDriftReport.",
        "tags": [
          "Translation"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        },
        "x-logical-path": "/translation/drift-report",
        "x-base44-function": "v1TranslationDriftReport",
        "x-base44-function-url": "https://lucidry.base44.app/functions/v1TranslationDriftReport",
        "x-required-scope": "jobs:read"
      }
    }
  },
  "tags": [
    {
      "name": "Jobs",
      "description": "Content refinement jobs"
    },
    {
      "name": "Translation",
      "description": "Translation and cross-language validation"
    },
    {
      "name": "Sources",
      "description": "Source asset management"
    },
    {
      "name": "Artifacts",
      "description": "Artifact download"
    },
    {
      "name": "Profiles",
      "description": "Transform profile management"
    },
    {
      "name": "Estimates",
      "description": "Pricing estimates"
    },
    {
      "name": "Usage",
      "description": "Billed usage history"
    },
    {
      "name": "Webhooks",
      "description": "Webhook management"
    },
    {
      "name": "Health",
      "description": "Service health"
    }
  ],
  "x-scopes": [
    {
      "scope": "jobs:read",
      "title": "Read jobs",
      "grants": "List and read jobs, sources, estimates, profiles and drift reports."
    },
    {
      "scope": "jobs:write",
      "title": "Create and cancel jobs",
      "grants": "Create refinement and translation jobs, register sources, cancel jobs. Implies jobs:read."
    },
    {
      "scope": "artifacts:read",
      "title": "Download artifacts",
      "grants": "Read artifact metadata and mint short-lived signed download URLs."
    },
    {
      "scope": "billing:read",
      "title": "Read billing usage",
      "grants": "Read the organization credit position and the masked usage ledger."
    },
    {
      "scope": "wallet:read",
      "title": "Read wallet",
      "grants": "Read the wallet balance, receipts and the per-principal usage summary."
    },
    {
      "scope": "webhooks:write",
      "title": "Manage webhooks",
      "grants": "Register, list and delete webhook endpoints. Signing secrets are returned once, on create."
    },
    {
      "scope": "admin",
      "title": "Administer the account",
      "grants": "Everything above, plus account-level configuration. Issue sparingly."
    },
    {
      "scope": "*",
      "title": "Unrestricted (legacy)",
      "grants": "Every scope. The default for keys created before scopes existed."
    }
  ],
  "x-rate-limits": {
    "standard": {
      "requests_per_minute": 60,
      "burst_requests": 20,
      "burst_seconds": 10,
      "retry_after_seconds": 60
    },
    "high": {
      "requests_per_minute": 300,
      "burst_requests": 60,
      "burst_seconds": 10,
      "retry_after_seconds": 20
    },
    "unlimited": {
      "requests_per_minute": null,
      "burst_requests": null,
      "burst_seconds": 10,
      "retry_after_seconds": 0
    }
  },
  "x-pricing": {
    "unit": "word",
    "free_trial_words": 1000,
    "free_trial_note": "One-time 1,000-word free trial, no card required. Not a monthly allowance.",
    "rates_per_word_usd": {
      "clean": 0.0024,
      "edit": 0.0045,
      "write": 0.009,
      "magic": 0.015
    },
    "tier_names": {
      "clean": "Essential Cleanup",
      "edit": "Clarity & Flow",
      "write": "Write Like Me",
      "magic": "Magic"
    },
    "professional_edit_note": "Professional Edit at 0.006 USD per word is available in the New Job wizard via the natural_conversational profile and has no public tier code.",
    "translate_base_price_per_word_usd": 0.02,
    "translate_note": "Translation bills the base rate times the language-pair tier multiplier (1.0x, 1.2x or 1.5x).",
    "pricing_manifest_url": "https://lucidry.base44.app/functions/servePricingJson"
  }
}