{"openapi":"3.1.0","info":{"title":"Project Nebula API","description":"Project Nebula is an OCR-as-a-service API. Upload documents (PDF, common image formats, and PowerPoint), run OCR to produce clean Markdown, and optionally run a structured-JSON extraction stage that maps the OCR output onto a schema you define. Supports single and batch jobs, folder uploads, multiple result formats (per-job Markdown/JSON, combined Markdown, or ZIP), and per-account usage reporting.\n\nAuthenticate with your API key in the `X-API-Key` header on most requests. To obtain a key: create an account (`POST /portal/signup`), sign in (`POST /portal/login`) to get a session, then mint a key with `POST /portal/api-keys` — those bootstrap routes use the session (cookie or `Authorization: Bearer`), not `X-API-Key`. `GET /healthz` is unauthenticated.","version":"0.4.0"},"paths":{"/healthz":{"get":{"tags":["Health"],"summary":"Health check","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}},"security":[]}},"/v1/models":{"get":{"tags":["Models"],"summary":"List available models","description":"Active models the authenticated caller can submit jobs to.\n\nAuthenticated (portal session or X-API-Key) and active-only — inactive\nmodels are omitted so the picker only ever shows callable choices. ``active``\nis therefore always true here, kept in the response for shape stability.","operationId":"list_models_v1_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ModelResponse"},"title":"Response List Models V1 Models Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/uploads":{"post":{"tags":["Uploads"],"summary":"Create presigned upload URL","operationId":"create_upload_v1_uploads_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/UploadCreateRequest"},{"type":"null"}],"title":"Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/uploads/batch":{"post":{"tags":["Uploads"],"summary":"Create presigned upload URLs for multiple files","operationId":"create_upload_batch_v1_uploads_batch_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchUploadCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchUploadCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/uploads/refresh":{"post":{"tags":["Uploads"],"summary":"Re-presign an expired upload URL","operationId":"refresh_upload_url_v1_uploads_refresh_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshUploadUrlRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshUploadUrlResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/jobs":{"post":{"tags":["Jobs"],"summary":"Create an OCR job","operationId":"create_job_v1_jobs_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJobRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]},"get":{"tags":["Jobs"],"summary":"List jobs with pagination","operationId":"list_jobs_v1_jobs_get","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Page Size"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/jobs/{job_id}":{"get":{"tags":["Jobs"],"summary":"Get job status","operationId":"get_job_v1_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]},"delete":{"tags":["Jobs"],"summary":"Delete a job and its files","description":"Soft-delete the job row and purge upload + result objects from S3.\nThe row stays for usage metering; the user can no longer see or download it.","operationId":"delete_job_v1_jobs__job_id__delete","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/jobs/{job_id}/source":{"get":{"tags":["Jobs"],"summary":"Get presigned URL for the original uploaded file","operationId":"get_job_source_v1_jobs__job_id__source_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSourceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/jobs/{job_id}/result":{"get":{"tags":["Jobs"],"summary":"Get job result with download URL","description":"Returns the result manifest: per-stage statuses + presigned artifact URLs.\n\nAvailable once OCR has produced markdown (status 'succeeded' or, when JSON\nextraction failed, 'partial_success'). ``download_url`` stays the markdown\nURL for back-compat; ``artifacts`` is the forward-looking per-artifact view.","operationId":"get_job_result_v1_jobs__job_id__result_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResultResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/jobs/{job_id}/expense-report":{"get":{"tags":["Jobs"],"summary":"Get expense job Excel review report","description":"Returns a presigned S3 download URL for a single expense job's XLSX report.","operationId":"get_job_expense_report_v1_jobs__job_id__expense_report_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseReportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/jobs/{job_id}/retry":{"post":{"tags":["Jobs"],"summary":"Retry a failed job","operationId":"retry_job_v1_jobs__job_id__retry_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/jobs/{job_id}/cancel":{"post":{"tags":["Jobs"],"summary":"Cancel a queued job","operationId":"cancel_job_v1_jobs__job_id__cancel_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/jobs/{job_id}/feedback":{"get":{"tags":["Jobs"],"summary":"List feedback for a job","description":"Return the job's feedback thread (oldest first). Scoped to the owner.","operationId":"list_job_feedback_v1_jobs__job_id__feedback_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]},"post":{"tags":["Jobs"],"summary":"Post feedback on a job","description":"Append a feedback message to the job's thread. Append-only — no edit/delete.","operationId":"create_job_feedback_v1_jobs__job_id__feedback_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/expense-jobs":{"post":{"tags":["Expense Jobs"],"summary":"Create a Spain culture-tax expense job","operationId":"create_expense_job_v1_expense_jobs_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExpenseJobRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/expense-jobs/batch":{"post":{"tags":["Expense Jobs"],"summary":"Create a batch of Spain culture-tax expense jobs","operationId":"create_expense_batch_jobs_v1_expense_jobs_batch_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExpenseBatchJobRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBatchJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/spread-jobs":{"post":{"tags":["Spread Jobs"],"summary":"Create a KSFS spread-processing job","operationId":"create_spread_job_v1_spread_jobs_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSpreadJobRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/spread-jobs/batch":{"post":{"tags":["Spread Jobs"],"summary":"Create a batch of KSFS spread-processing jobs","operationId":"create_spread_batch_jobs_v1_spread_jobs_batch_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSpreadBatchJobRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBatchJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/capabilities":{"get":{"tags":["Capabilities"],"summary":"List enabled workflows","operationId":"get_capabilities_v1_capabilities_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapabilityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/batches":{"get":{"tags":["Batches"],"summary":"List batches with pagination","description":"List all batches for the authenticated API key, with summary stats per batch.","operationId":"list_batches_v1_batches_get","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Page Size"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/jobs/batch":{"post":{"tags":["Batches"],"summary":"Create a batch of OCR jobs","operationId":"create_batch_jobs_v1_jobs_batch_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBatchJobRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBatchJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/batches/{batch_id}":{"get":{"tags":["Batches"],"summary":"Get batch status","operationId":"get_batch_v1_batches__batch_id__get","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]},"delete":{"tags":["Batches"],"summary":"Delete a batch and all its files","description":"Soft-delete every job in the batch and purge their S3 objects, plus the\nbatch's combined merged.md if it was generated. Rows stay for usage\nmetering; the user can no longer see or download them.","operationId":"delete_batch_v1_batches__batch_id__delete","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Batch V1 Batches  Batch Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/batches/{batch_id}/result":{"get":{"tags":["Batches"],"summary":"Get a batch result manifest","description":"Per-child artifact manifest. A terminal batch with mixed child outcomes\nreports status 'partial_success'; one failed child never invalidates the\nothers. The synthetic merge row is excluded from the items list but its\noutput is surfaced as ``merged_markdown_url``.","operationId":"get_batch_result_v1_batches__batch_id__result_get","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchResultManifest"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/batches/{batch_id}/cancel":{"post":{"tags":["Batches"],"summary":"Cancel all queued jobs in a batch","operationId":"cancel_batch_v1_batches__batch_id__cancel_post","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cancel Batch V1 Batches  Batch Id  Cancel Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/batches/{batch_id}/download":{"get":{"tags":["Batches"],"summary":"Download all batch results as a ZIP","description":"Build a ZIP archive of all succeeded job results in the batch, preserving directory structure.","operationId":"download_batch_v1_batches__batch_id__download_get","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/batches/{batch_id}/merge":{"get":{"tags":["Batches"],"summary":"Download combined markdown for the batch","description":"Redirect to a presigned URL for the batch's combined markdown.\n\nReturns 404 if the merged file isn't in S3 yet — worker hasn't finished\nbuilding it, or the batch has zero succeeded jobs. The UI only surfaces\nthis link when BatchStatusResponse.merged_download_url is set, so users\ntypically don't see the 404 path.","operationId":"download_batch_merge_v1_batches__batch_id__merge_get","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]},"post":{"tags":["Batches"],"summary":"Force rebuild combined markdown","description":"Manually enqueue a merge task. Useful if the initial merge failed or\nresults need to be regenerated after a manual fix.","operationId":"rebuild_batch_merge_v1_batches__batch_id__merge_post","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Rebuild Batch Merge V1 Batches  Batch Id  Merge Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/batches/{batch_id}/expense-report":{"get":{"tags":["Batches"],"summary":"Get batch expense Excel review report","description":"Return a presigned URL for the batch-level expense review workbook.","operationId":"download_batch_expense_report_v1_batches__batch_id__expense_report_get","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseReportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/batches/{batch_id}/spread-report":{"get":{"tags":["Batches"],"summary":"Get batch KSFS spread ZIP report","operationId":"download_batch_spread_report_v1_batches__batch_id__spread_report_get","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseReportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/custom-prompt":{"get":{"tags":["Custom Prompt"],"summary":"Get the current effective OCR prompt","operationId":"get_custom_prompt_v1_custom_prompt_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomPromptResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]},"put":{"tags":["Custom Prompt"],"summary":"Replace the customer's OCR prompt override","operationId":"put_custom_prompt_v1_custom_prompt_put","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomPromptWriteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomPromptResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/extraction-profiles":{"get":{"tags":["Extraction Profiles"],"summary":"List the tenant's extraction profiles","operationId":"list_extraction_profiles_v1_extraction_profiles_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionProfileListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]},"post":{"tags":["Extraction Profiles"],"summary":"Create or update an extraction profile","operationId":"put_extraction_profile_v1_extraction_profiles_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionProfileWriteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/extraction-profiles/{name}":{"get":{"tags":["Extraction Profiles"],"summary":"Get the current extraction profile (with system-default fallback)","operationId":"get_extraction_profile_v1_extraction_profiles__name__get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/extraction-profiles/{name}/versions":{"get":{"tags":["Extraction Profiles"],"summary":"List an extraction profile's version history","operationId":"list_extraction_profile_versions_v1_extraction_profiles__name__versions_get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionProfileVersionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/extraction-profiles/{name}/versions/{version}":{"get":{"tags":["Extraction Profiles"],"summary":"Get a specific extraction-profile version","operationId":"get_extraction_profile_version_v1_extraction_profiles__name__versions__version__get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"version","in":"path","required":true,"schema":{"type":"integer","title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/extraction-profiles/{name}/rollback":{"post":{"tags":["Extraction Profiles"],"summary":"Roll an extraction profile forward to a copy of an earlier version","operationId":"rollback_extraction_profile_v1_extraction_profiles__name__rollback_post","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionProfileRollbackRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/account/usage":{"get":{"tags":["Usage"],"summary":"Account-level usage broken down by model and month","description":"Live aggregation over the caller's jobs. No rollup table — queries the\n`jobs` table directly. Pass ISO8601 `from`/`to` (inclusive / exclusive) to\nbound the range; omit for lifetime totals.","operationId":"get_account_usage_v1_account_usage_get","parameters":[{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountUsageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/account/usage.csv":{"get":{"tags":["Usage"],"summary":"Download account usage as CSV (one row per job)","operationId":"download_account_usage_csv_v1_account_usage_csv_get","parameters":[{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v1/batches/{batch_id}/usage.csv":{"get":{"tags":["Usage"],"summary":"Download per-batch usage as CSV (one row per job)","operationId":"download_batch_usage_csv_v1_batches__batch_id__usage_csv_get","parameters":[{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/portal/signup":{"post":{"tags":["Portal Auth"],"summary":"Create a portal account","operationId":"signup_portal_signup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/portal/login":{"post":{"tags":["Portal Auth"],"summary":"Sign in","operationId":"login_portal_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/portal/mfa/verify":{"post":{"tags":["Portal MFA"],"summary":"Complete login with a TOTP code","operationId":"verify_portal_mfa_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaVerifyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/portal/api-keys":{"get":{"tags":["Portal API Keys"],"summary":"List my API keys (no raw values)","operationId":"list_api_keys_portal_api_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyListResponse"}}}}},"security":[{"SessionCookie":[]},{"SessionBearer":[]}]},"post":{"tags":["Portal API Keys"],"summary":"Mint a personal API key (raw value shown once)","operationId":"create_api_key_portal_api_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreateRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"SessionCookie":[]},{"SessionBearer":[]}]}},"/portal/api-keys/{key_id}":{"delete":{"tags":["Portal API Keys"],"summary":"Revoke one of my API keys","operationId":"revoke_api_key_portal_api_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"SessionCookie":[]},{"SessionBearer":[]}]}},"/portal/billing/wallet":{"get":{"tags":["Billing"],"summary":"Credit balance, plan, and auto-reload settings","operationId":"get_wallet_portal_billing_wallet_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/portal/billing/rate-card":{"get":{"tags":["Billing"],"summary":"Published credit rate card + purchasable products","operationId":"get_rate_card_portal_billing_rate_card_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateCardResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/portal/billing/estimate":{"post":{"tags":["Billing"],"summary":"Estimate credits for a job before running it","operationId":"estimate_portal_billing_estimate_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EstimateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EstimateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/portal/billing/ledger":{"get":{"tags":["Billing"],"summary":"Credit transaction history (audit trail)","operationId":"get_ledger_portal_billing_ledger_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LedgerListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/portal/billing/usage":{"get":{"tags":["Billing"],"summary":"Per-job usage with credit cost","operationId":"get_usage_portal_billing_usage_get","parameters":[{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"To"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingUsageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/portal/billing/usage.csv":{"get":{"tags":["Billing"],"summary":"Download per-job usage with credits as CSV","operationId":"download_usage_csv_portal_billing_usage_csv_get","parameters":[{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}}},"components":{"schemas":{"AccountUsageResponse":{"properties":{"api_key_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key Name"},"from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"From"},"to":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"To"},"first_job_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Job At"},"last_job_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Job At"},"totals":{"$ref":"#/components/schemas/UsageBucket"},"by_model":{"items":{"$ref":"#/components/schemas/UsageByModel"},"type":"array","title":"By Model"},"by_month":{"items":{"$ref":"#/components/schemas/UsageByMonth"},"type":"array","title":"By Month"}},"type":"object","required":["totals","by_model","by_month"],"title":"AccountUsageResponse"},"ApiKeyCreateRequest":{"properties":{"name":{"type":"string","title":"Name"},"scope":{"type":"string","enum":["ocr","expense_processing","spread_processing"],"title":"Scope","default":"ocr"}},"type":"object","required":["name"],"title":"ApiKeyCreateRequest"},"ApiKeyCreateResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"scope":{"type":"string","enum":["ocr","expense_processing","spread_processing"],"title":"Scope","default":"ocr"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"deactivated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deactivated At"},"raw_key":{"type":"string","title":"Raw Key"}},"type":"object","required":["id","name","is_active","created_at","raw_key"],"title":"ApiKeyCreateResponse"},"ApiKeyListResponse":{"properties":{"keys":{"items":{"$ref":"#/components/schemas/ApiKeyResponse"},"type":"array","title":"Keys"}},"type":"object","required":["keys"],"title":"ApiKeyListResponse"},"ApiKeyResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"scope":{"type":"string","enum":["ocr","expense_processing","spread_processing"],"title":"Scope","default":"ocr"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"deactivated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deactivated At"}},"type":"object","required":["id","name","is_active","created_at"],"title":"ApiKeyResponse"},"AutoReloadConfig":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"threshold_credits":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Threshold Credits"},"amount_credits":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount Credits"},"pack_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pack Code"}},"type":"object","required":["enabled","threshold_credits","amount_credits","pack_code"],"title":"AutoReloadConfig"},"BatchJobSummary":{"properties":{"job_id":{"type":"string","title":"Job Id"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","partial_success"],"title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["job_id","status","created_at"],"title":"BatchJobSummary"},"BatchListItem":{"properties":{"batch_id":{"type":"string","title":"Batch Id"},"folder_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder Name"},"model_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Id"},"total_jobs":{"type":"integer","title":"Total Jobs"},"status_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Status Counts"},"total_pages":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Pages"},"total_completion_tokens":{"type":"integer","title":"Total Completion Tokens","default":0},"total_processing_seconds":{"type":"number","title":"Total Processing Seconds","default":0.0},"total_server_load":{"type":"number","title":"Total Server Load","default":0.0},"created_at":{"type":"string","format":"date-time","title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["batch_id","total_jobs","status_counts","created_at"],"title":"BatchListItem"},"BatchListResponse":{"properties":{"batches":{"items":{"$ref":"#/components/schemas/BatchListItem"},"type":"array","title":"Batches"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"}},"type":"object","required":["batches","total","page","page_size"],"title":"BatchListResponse"},"BatchResultItem":{"properties":{"job_id":{"type":"string","title":"Job Id"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"relative_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Relative Path"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","partial_success"],"title":"Status"},"markdown_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Markdown Url"},"json_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Json Url"},"error_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Text"}},"type":"object","required":["job_id","status"],"title":"BatchResultItem"},"BatchResultManifest":{"properties":{"batch_id":{"type":"string","title":"Batch Id"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","partial_success"],"title":"Status"},"partial_success":{"type":"boolean","title":"Partial Success"},"output_format":{"anyOf":[{"type":"string","enum":["json","markdown","both"]},{"type":"null"}],"title":"Output Format"},"total_jobs":{"type":"integer","title":"Total Jobs"},"status_counts":{"additionalProperties":{"type":"integer"},"propertyNames":{"enum":["queued","running","succeeded","failed","cancelled","partial_success"]},"type":"object","title":"Status Counts"},"merged_markdown_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Merged Markdown Url"},"items":{"items":{"$ref":"#/components/schemas/BatchResultItem"},"type":"array","title":"Items"},"expires_in_seconds":{"type":"integer","title":"Expires In Seconds"}},"type":"object","required":["batch_id","status","partial_success","total_jobs","status_counts","items","expires_in_seconds"],"title":"BatchResultManifest"},"BatchStatusResponse":{"properties":{"batch_id":{"type":"string","title":"Batch Id"},"folder_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder Name"},"total_jobs":{"type":"integer","title":"Total Jobs"},"status_counts":{"additionalProperties":{"type":"integer"},"propertyNames":{"enum":["queued","running","succeeded","failed","cancelled","partial_success"]},"type":"object","title":"Status Counts"},"jobs":{"items":{"$ref":"#/components/schemas/UserJobResponse"},"type":"array","title":"Jobs"},"merged_download_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Merged Download Url"},"usage":{"anyOf":[{"$ref":"#/components/schemas/BatchUsageSummary"},{"type":"null"}]}},"type":"object","required":["batch_id","total_jobs","status_counts","jobs"],"title":"BatchStatusResponse"},"BatchUploadCreateRequest":{"properties":{"files":{"items":{"$ref":"#/components/schemas/UploadCreateRequest"},"type":"array","title":"Files"}},"type":"object","required":["files"],"title":"BatchUploadCreateRequest"},"BatchUploadCreateResponse":{"properties":{"batch_upload_id":{"type":"string","title":"Batch Upload Id"},"files":{"items":{"$ref":"#/components/schemas/UploadCreateResponse"},"type":"array","title":"Files"}},"type":"object","required":["batch_upload_id","files"],"title":"BatchUploadCreateResponse"},"BatchUsagePerModel":{"properties":{"model_id":{"type":"string","title":"Model Id"},"jobs":{"type":"integer","title":"Jobs"},"completion_tokens":{"type":"integer","title":"Completion Tokens","default":0},"processing_seconds":{"type":"number","title":"Processing Seconds","default":0.0},"server_load":{"type":"number","title":"Server Load","default":0.0},"pages":{"type":"integer","title":"Pages","default":0}},"type":"object","required":["model_id","jobs"],"title":"BatchUsagePerModel"},"BatchUsageSummary":{"properties":{"total_jobs":{"type":"integer","title":"Total Jobs","default":0},"total_pages":{"type":"integer","title":"Total Pages","default":0},"total_file_size_bytes":{"type":"integer","title":"Total File Size Bytes","default":0},"total_completion_tokens":{"type":"integer","title":"Total Completion Tokens","default":0},"total_processing_seconds":{"type":"number","title":"Total Processing Seconds","default":0.0},"total_server_load":{"type":"number","title":"Total Server Load","default":0.0},"avg_queue_wait_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Queue Wait Seconds"},"by_model":{"items":{"$ref":"#/components/schemas/BatchUsagePerModel"},"type":"array","title":"By Model"}},"type":"object","title":"BatchUsageSummary"},"BillingUsageResponse":{"properties":{"jobs":{"items":{"$ref":"#/components/schemas/JobUsageRow"},"type":"array","title":"Jobs"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"has_more":{"type":"boolean","title":"Has More"},"total_credits_in_page":{"type":"integer","title":"Total Credits In Page"}},"type":"object","required":["jobs","limit","offset","has_more","total_credits_in_page"],"title":"BillingUsageResponse"},"CapabilityResponse":{"properties":{"workflows":{"items":{"type":"string"},"type":"array","title":"Workflows"}},"type":"object","required":["workflows"],"title":"CapabilityResponse"},"CreateBatchJobFile":{"properties":{"upload_key":{"type":"string","title":"Upload Key"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"file_size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size Bytes"},"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type"},"relative_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Relative Path"}},"type":"object","required":["upload_key"],"title":"CreateBatchJobFile"},"CreateBatchJobRequest":{"properties":{"files":{"anyOf":[{"items":{"$ref":"#/components/schemas/CreateBatchJobFile"},"type":"array"},{"type":"null"}],"title":"Files"},"upload_keys":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Upload Keys"},"model_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Id"},"options":{"$ref":"#/components/schemas/OCRJobOptions"},"output_format":{"anyOf":[{"type":"string","enum":["json","markdown","both"]},{"type":"null"}],"title":"Output Format"},"extraction_profile_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Extraction Profile Name"},"extraction_profile_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Extraction Profile Version"}},"type":"object","title":"CreateBatchJobRequest"},"CreateBatchJobResponse":{"properties":{"batch_id":{"type":"string","title":"Batch Id"},"status":{"type":"string","const":"queued","title":"Status"},"jobs":{"items":{"$ref":"#/components/schemas/BatchJobSummary"},"type":"array","title":"Jobs"}},"type":"object","required":["batch_id","status","jobs"],"title":"CreateBatchJobResponse"},"CreateExpenseBatchJobRequest":{"properties":{"files":{"anyOf":[{"items":{"$ref":"#/components/schemas/CreateBatchJobFile"},"type":"array"},{"type":"null"}],"title":"Files"},"upload_keys":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Upload Keys"}},"type":"object","title":"CreateExpenseBatchJobRequest"},"CreateExpenseJobRequest":{"properties":{"upload_key":{"type":"string","title":"Upload Key"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"file_size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size Bytes"},"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type"},"relative_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Relative Path"}},"type":"object","required":["upload_key"],"title":"CreateExpenseJobRequest"},"CreateJobRequest":{"properties":{"upload_key":{"type":"string","title":"Upload Key"},"model_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Id"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"file_size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size Bytes"},"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type"},"relative_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Relative Path"},"options":{"$ref":"#/components/schemas/OCRJobOptions"},"output_format":{"anyOf":[{"type":"string","enum":["json","markdown","both"]},{"type":"null"}],"title":"Output Format"},"extraction_profile_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Extraction Profile Name"},"extraction_profile_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Extraction Profile Version"}},"type":"object","required":["upload_key"],"title":"CreateJobRequest"},"CreateJobResponse":{"properties":{"job_id":{"type":"string","title":"Job Id"},"batch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batch Id"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","partial_success"],"title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["job_id","status","created_at"],"title":"CreateJobResponse"},"CreateSpreadBatchJobRequest":{"properties":{"files":{"anyOf":[{"items":{"$ref":"#/components/schemas/CreateBatchJobFile"},"type":"array"},{"type":"null"}],"title":"Files"},"upload_keys":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Upload Keys"}},"type":"object","title":"CreateSpreadBatchJobRequest"},"CreateSpreadJobRequest":{"properties":{"upload_key":{"type":"string","title":"Upload Key"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"file_size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size Bytes"},"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type"},"relative_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Relative Path"}},"type":"object","required":["upload_key"],"title":"CreateSpreadJobRequest"},"CustomPromptResponse":{"properties":{"name":{"type":"string","title":"Name"},"content":{"type":"string","title":"Content"},"source":{"type":"string","enum":["tenant","default"],"title":"Source"},"is_override":{"type":"boolean","title":"Is Override"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"}},"type":"object","required":["name","content","source","is_override"],"title":"CustomPromptResponse","description":"The customer's effective OCR base prompt (single current value).\n\nVersioning is internal — customers see only the current effective prompt and\nwhether it's their own override (``source == \"tenant\"``) or the system\ndefault fallback. ``version`` is populated only for tenant-owned overrides."},"CustomPromptWriteRequest":{"properties":{"content":{"type":"string","title":"Content"},"change_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Change Note"}},"type":"object","required":["content"],"title":"CustomPromptWriteRequest"},"EstimateRequest":{"properties":{"pages":{"type":"integer","minimum":0.0,"title":"Pages","default":0},"prompt_tokens":{"type":"integer","minimum":0.0,"title":"Prompt Tokens","default":0},"completion_tokens":{"type":"integer","minimum":0.0,"title":"Completion Tokens","default":0},"model_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Id"}},"type":"object","title":"EstimateRequest"},"EstimateResponse":{"properties":{"page_credits":{"type":"number","title":"Page Credits"},"prompt_token_credits":{"type":"number","title":"Prompt Token Credits"},"completion_token_credits":{"type":"number","title":"Completion Token Credits"},"model_multiplier":{"type":"number","title":"Model Multiplier"},"total_credits":{"type":"integer","title":"Total Credits"},"total_usd":{"type":"number","title":"Total Usd"}},"type":"object","required":["page_credits","prompt_token_credits","completion_token_credits","model_multiplier","total_credits","total_usd"],"title":"EstimateResponse"},"ExpenseReportResponse":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","title":"Status"},"result_filename":{"type":"string","title":"Result Filename"},"download_url":{"type":"string","title":"Download Url"}},"type":"object","required":["id","status","result_filename","download_url"],"title":"ExpenseReportResponse"},"ExtractionProfileListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ExtractionProfileSummary"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"ExtractionProfileListResponse"},"ExtractionProfileResponse":{"properties":{"name":{"type":"string","title":"Name"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"},"json_schema":{"additionalProperties":true,"type":"object","title":"Json Schema"},"instruction_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instruction Prompt"},"examples":{"items":{},"type":"array","title":"Examples"},"change_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Change Note"},"source":{"anyOf":[{"type":"string","enum":["tenant","default"]},{"type":"null"}],"title":"Source"}},"type":"object","required":["name","json_schema"],"title":"ExtractionProfileResponse","description":"An extraction profile's current (or pinned) version."},"ExtractionProfileRollbackRequest":{"properties":{"version":{"type":"integer","title":"Version"},"change_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Change Note"}},"type":"object","required":["version"],"title":"ExtractionProfileRollbackRequest"},"ExtractionProfileSummary":{"properties":{"name":{"type":"string","title":"Name"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"},"change_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Change Note"}},"type":"object","required":["name"],"title":"ExtractionProfileSummary"},"ExtractionProfileVersionSummary":{"properties":{"version":{"type":"integer","title":"Version"},"change_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Change Note"},"is_current":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Current"}},"type":"object","required":["version"],"title":"ExtractionProfileVersionSummary"},"ExtractionProfileVersionsResponse":{"properties":{"name":{"type":"string","title":"Name"},"versions":{"items":{"$ref":"#/components/schemas/ExtractionProfileVersionSummary"},"type":"array","title":"Versions"}},"type":"object","required":["name","versions"],"title":"ExtractionProfileVersionsResponse"},"ExtractionProfileWriteRequest":{"properties":{"name":{"type":"string","title":"Name"},"json_schema":{"additionalProperties":true,"type":"object","title":"Json Schema"},"instruction_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instruction Prompt"},"examples":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Examples"},"change_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Change Note"}},"type":"object","required":["name","json_schema"],"title":"ExtractionProfileWriteRequest","description":"Create/replace an extraction profile (appends a new version internally).\n\n``json_schema`` must conform to Anthropic's structured-output subset — it is\nvalidated on write (see extraction.schema_subset), so an unsupported schema\nreturns a 422 here rather than failing mid-extraction."},"FeedbackCreateRequest":{"properties":{"message":{"type":"string","maxLength":5000,"minLength":1,"title":"Message"}},"type":"object","required":["message"],"title":"FeedbackCreateRequest"},"FeedbackListResponse":{"properties":{"feedback":{"items":{"$ref":"#/components/schemas/FeedbackResponse"},"type":"array","title":"Feedback"}},"type":"object","required":["feedback"],"title":"FeedbackListResponse"},"FeedbackResponse":{"properties":{"id":{"type":"string","title":"Id"},"message":{"type":"string","title":"Message"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","message","created_at"],"title":"FeedbackResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","title":"Status"}},"type":"object","required":["status"],"title":"HealthResponse"},"JobListResponse":{"properties":{"jobs":{"items":{"$ref":"#/components/schemas/UserJobResponse"},"type":"array","title":"Jobs"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"}},"type":"object","required":["jobs","total","page","page_size"],"title":"JobListResponse"},"JobResultResponse":{"properties":{"job_id":{"type":"string","title":"Job Id"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","partial_success"],"title":"Status"},"ocr_status":{"type":"string","enum":["pending","running","succeeded","failed"],"title":"Ocr Status","default":"pending"},"json_status":{"type":"string","enum":["not_requested","pending","running","succeeded","failed"],"title":"Json Status","default":"not_requested"},"output_format":{"anyOf":[{"type":"string","enum":["json","markdown","both"]},{"type":"null"}],"title":"Output Format"},"artifacts":{"items":{"$ref":"#/components/schemas/ResultArtifact"},"type":"array","title":"Artifacts"},"expires_in_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires In Seconds"},"result_filename":{"type":"string","title":"Result Filename"},"download_url":{"type":"string","title":"Download Url"},"truncated":{"type":"boolean","title":"Truncated","default":false},"total_pages":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Pages"},"returned_pages":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Returned Pages"}},"type":"object","required":["job_id","status","result_filename","download_url"],"title":"JobResultResponse"},"JobSourceResponse":{"properties":{"job_id":{"type":"string","title":"Job Id"},"source_url":{"type":"string","title":"Source Url"},"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"preview_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preview Url"},"preview_content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preview Content Type"},"preview_filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preview Filename"}},"type":"object","required":["job_id","source_url"],"title":"JobSourceResponse"},"JobUsageRow":{"properties":{"job_id":{"type":"string","title":"Job Id"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"model_id":{"type":"string","title":"Model Id"},"status":{"type":"string","title":"Status"},"pages":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pages"},"prompt_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Prompt Tokens"},"completion_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Completion Tokens"},"credits":{"type":"integer","title":"Credits"},"usd":{"type":"number","title":"Usd"}},"type":"object","required":["job_id","created_at","completed_at","filename","model_id","status","pages","prompt_tokens","completion_tokens","credits","usd"],"title":"JobUsageRow"},"LedgerEntryResponse":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"direction":{"type":"string","title":"Direction"},"amount":{"type":"integer","title":"Amount"},"entry_type":{"type":"string","title":"Entry Type"},"source_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Ref"},"external_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Ref"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["id","created_at","direction","amount","entry_type","source_ref","external_ref","reason"],"title":"LedgerEntryResponse"},"LedgerListResponse":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/LedgerEntryResponse"},"type":"array","title":"Entries"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["entries","limit","offset","has_more"],"title":"LedgerListResponse"},"LoginRequest":{"properties":{"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"},"return_token":{"type":"boolean","title":"Return Token","default":false}},"type":"object","required":["email","password"],"title":"LoginRequest"},"LoginResponse":{"properties":{"requires_mfa":{"type":"boolean","title":"Requires Mfa","default":false},"mfa_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mfa Token"},"user":{"anyOf":[{"$ref":"#/components/schemas/UserResponse"},{"type":"null"}]},"access_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Access Token"},"token_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token Type"},"expires_in":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires In"}},"type":"object","title":"LoginResponse"},"MessageResponse":{"properties":{"message":{"type":"string","title":"Message"}},"type":"object","required":["message"],"title":"MessageResponse"},"MfaVerifyRequest":{"properties":{"mfa_token":{"type":"string","title":"Mfa Token"},"code":{"type":"string","title":"Code"},"return_token":{"type":"boolean","title":"Return Token","default":false}},"type":"object","required":["mfa_token","code"],"title":"MfaVerifyRequest"},"ModelResponse":{"properties":{"model_id":{"type":"string","title":"Model Id"},"display_name":{"type":"string","title":"Display Name"},"active":{"type":"boolean","title":"Active"},"ocr_models":{"items":{"type":"string"},"type":"array","title":"Ocr Models"},"default_ocr_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Ocr Model"}},"type":"object","required":["model_id","display_name","active"],"title":"ModelResponse"},"OCRJobOptions":{"properties":{"response_format":{"type":"string","enum":["json","markdown","both"],"title":"Response Format","default":"both"},"merge_tables":{"type":"boolean","title":"Merge Tables","default":false},"relevel_titles":{"type":"boolean","title":"Relevel Titles","default":false},"concatenate_pages":{"type":"boolean","title":"Concatenate Pages","default":false},"Custom_Prompt":{"anyOf":[{"type":"string","enum":["standard conversion","excel extraction"]},{"type":"null"}],"title":"Custom Prompt"},"ocr_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ocr Model"}},"type":"object","title":"OCRJobOptions"},"PlanSummary":{"properties":{"plan_code":{"type":"string","title":"Plan Code"},"plan_display_name":{"type":"string","title":"Plan Display Name"},"status":{"type":"string","title":"Status"},"included_credits_per_cycle":{"type":"integer","title":"Included Credits Per Cycle"},"current_period_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Current Period End"},"cancel_at_period_end":{"type":"boolean","title":"Cancel At Period End"}},"type":"object","required":["plan_code","plan_display_name","status","included_credits_per_cycle","current_period_end","cancel_at_period_end"],"title":"PlanSummary"},"ProductResponse":{"properties":{"code":{"type":"string","title":"Code"},"display_name":{"type":"string","title":"Display Name"},"credits":{"type":"integer","title":"Credits"},"amount_usd":{"type":"number","title":"Amount Usd"},"rollover":{"type":"boolean","title":"Rollover","default":false},"tagline":{"type":"string","title":"Tagline","default":""},"features":{"items":{"type":"string"},"type":"array","title":"Features","default":[]},"popular":{"type":"boolean","title":"Popular","default":false}},"type":"object","required":["code","display_name","credits","amount_usd"],"title":"ProductResponse"},"RateCardResponse":{"properties":{"credits_per_usd":{"type":"integer","title":"Credits Per Usd"},"credits_per_page":{"type":"number","title":"Credits Per Page"},"credits_per_1k_prompt_tokens":{"type":"number","title":"Credits Per 1K Prompt Tokens"},"credits_per_1k_completion_tokens":{"type":"number","title":"Credits Per 1K Completion Tokens"},"model_multipliers":{"additionalProperties":{"type":"number"},"type":"object","title":"Model Multipliers"},"signup_grant_credits":{"type":"integer","title":"Signup Grant Credits"},"topup_packs":{"items":{"$ref":"#/components/schemas/ProductResponse"},"type":"array","title":"Topup Packs"},"plans":{"items":{"$ref":"#/components/schemas/ProductResponse"},"type":"array","title":"Plans"},"roi":{"$ref":"#/components/schemas/RoiResponse"}},"type":"object","required":["credits_per_usd","credits_per_page","credits_per_1k_prompt_tokens","credits_per_1k_completion_tokens","model_multipliers","signup_grant_credits","topup_packs","plans","roi"],"title":"RateCardResponse"},"RefreshUploadUrlRequest":{"properties":{"s3_key":{"type":"string","title":"S3 Key"},"content_type":{"type":"string","title":"Content Type","default":"application/octet-stream"}},"type":"object","required":["s3_key"],"title":"RefreshUploadUrlRequest"},"RefreshUploadUrlResponse":{"properties":{"s3_key":{"type":"string","title":"S3 Key"},"upload_url":{"type":"string","title":"Upload Url"},"expires_in_seconds":{"type":"integer","title":"Expires In Seconds"}},"type":"object","required":["s3_key","upload_url","expires_in_seconds"],"title":"RefreshUploadUrlResponse"},"ResultArtifact":{"properties":{"type":{"type":"string","enum":["markdown","json"],"title":"Type"},"status":{"type":"string","title":"Status"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["type","status"],"title":"ResultArtifact","description":"One downloadable output of a job. ``status`` is the producing stage's\nstatus; ``url`` is a presigned GET (absent when the artifact isn't ready);\n``error`` carries a user-safe message when that stage failed."},"RoiResponse":{"properties":{"manual_minutes_per_page":{"type":"number","title":"Manual Minutes Per Page"},"hourly_rate_usd":{"type":"number","title":"Hourly Rate Usd"},"default_pages_per_month":{"type":"integer","title":"Default Pages Per Month"}},"type":"object","required":["manual_minutes_per_page","hourly_rate_usd","default_pages_per_month"],"title":"RoiResponse"},"SignupRequest":{"properties":{"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"},"name":{"type":"string","title":"Name","default":""},"referral_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Referral Code"},"locale":{"type":"string","enum":["ja","en"],"title":"Locale","default":"ja"}},"type":"object","required":["email","password"],"title":"SignupRequest"},"UploadCreateRequest":{"properties":{"filename":{"type":"string","title":"Filename","default":"upload.bin"},"content_type":{"type":"string","title":"Content Type","default":"application/octet-stream"},"relative_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Relative Path"},"file_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Hash"},"file_size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size Bytes"}},"type":"object","title":"UploadCreateRequest"},"UploadCreateResponse":{"properties":{"upload_id":{"type":"string","title":"Upload Id"},"s3_key":{"type":"string","title":"S3 Key"},"upload_url":{"type":"string","title":"Upload Url"},"expires_in_seconds":{"type":"integer","title":"Expires In Seconds"},"file_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Hash"}},"type":"object","required":["upload_id","s3_key","upload_url","expires_in_seconds"],"title":"UploadCreateResponse"},"UsageBucket":{"properties":{"jobs":{"type":"integer","title":"Jobs","default":0},"succeeded":{"type":"integer","title":"Succeeded","default":0},"failed":{"type":"integer","title":"Failed","default":0},"cancelled":{"type":"integer","title":"Cancelled","default":0},"pages":{"type":"integer","title":"Pages","default":0},"file_size_bytes":{"type":"integer","title":"File Size Bytes","default":0},"completion_tokens":{"type":"integer","title":"Completion Tokens","default":0},"processing_seconds":{"type":"number","title":"Processing Seconds","default":0.0},"server_load":{"type":"number","title":"Server Load","default":0.0}},"type":"object","title":"UsageBucket"},"UsageByModel":{"properties":{"jobs":{"type":"integer","title":"Jobs","default":0},"succeeded":{"type":"integer","title":"Succeeded","default":0},"failed":{"type":"integer","title":"Failed","default":0},"cancelled":{"type":"integer","title":"Cancelled","default":0},"pages":{"type":"integer","title":"Pages","default":0},"file_size_bytes":{"type":"integer","title":"File Size Bytes","default":0},"completion_tokens":{"type":"integer","title":"Completion Tokens","default":0},"processing_seconds":{"type":"number","title":"Processing Seconds","default":0.0},"server_load":{"type":"number","title":"Server Load","default":0.0},"model_id":{"type":"string","title":"Model Id"}},"type":"object","required":["model_id"],"title":"UsageByModel"},"UsageByMonth":{"properties":{"jobs":{"type":"integer","title":"Jobs","default":0},"succeeded":{"type":"integer","title":"Succeeded","default":0},"failed":{"type":"integer","title":"Failed","default":0},"cancelled":{"type":"integer","title":"Cancelled","default":0},"pages":{"type":"integer","title":"Pages","default":0},"file_size_bytes":{"type":"integer","title":"File Size Bytes","default":0},"completion_tokens":{"type":"integer","title":"Completion Tokens","default":0},"processing_seconds":{"type":"number","title":"Processing Seconds","default":0.0},"server_load":{"type":"number","title":"Server Load","default":0.0},"month":{"type":"string","title":"Month"}},"type":"object","required":["month"],"title":"UsageByMonth"},"UserJobResponse":{"properties":{"job_id":{"type":"string","title":"Job Id"},"batch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batch Id"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled","partial_success"],"title":"Status"},"ocr_status":{"type":"string","enum":["pending","running","succeeded","failed"],"title":"Ocr Status","default":"pending"},"json_status":{"type":"string","enum":["not_requested","pending","running","succeeded","failed"],"title":"Json Status","default":"not_requested"},"output_format":{"anyOf":[{"type":"string","enum":["json","markdown","both"]},{"type":"null"}],"title":"Output Format"},"model_id":{"type":"string","title":"Model Id"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"relative_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Relative Path"},"file_size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size Bytes"},"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type"},"pages":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pages"},"pages_succeeded":{"type":"integer","title":"Pages Succeeded","default":0},"pages_failed":{"type":"integer","title":"Pages Failed","default":0},"processing_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Processing Seconds"},"server_load":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Server Load"},"total_completion_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Completion Tokens"},"queue_wait_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Queue Wait Seconds"},"error_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Text"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["job_id","status","model_id","created_at","updated_at"],"title":"UserJobResponse","description":"Public job view for API-key-authenticated clients.\n\nThe admin-only counterpart (``JobResponse``) carries additional fields\nthat are intentionally not part of the public contract — keep that\ndistinction when editing either schema."},"UserResponse":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"name":{"type":"string","title":"Name"},"is_verified":{"type":"boolean","title":"Is Verified"},"is_superuser":{"type":"boolean","title":"Is Superuser"},"totp_enabled":{"type":"boolean","title":"Totp Enabled"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"billing_enabled":{"type":"boolean","title":"Billing Enabled","default":false}},"type":"object","required":["id","email","name","is_verified","is_superuser","totp_enabled","created_at"],"title":"UserResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WalletResponse":{"properties":{"balance_credits":{"type":"integer","title":"Balance Credits"},"held_credits":{"type":"integer","title":"Held Credits"},"available_credits":{"type":"integer","title":"Available Credits"},"balance_usd":{"type":"number","title":"Balance Usd"},"available_usd":{"type":"number","title":"Available Usd"},"status":{"type":"string","title":"Status"},"has_payment_method":{"type":"boolean","title":"Has Payment Method"},"low_balance_threshold_credits":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Low Balance Threshold Credits"},"monthly_spend_cap_credits":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Monthly Spend Cap Credits"},"spent_this_period_credits":{"type":"integer","title":"Spent This Period Credits"},"auto_reload":{"$ref":"#/components/schemas/AutoReloadConfig"},"plan":{"anyOf":[{"$ref":"#/components/schemas/PlanSummary"},{"type":"null"}]}},"type":"object","required":["balance_credits","held_credits","available_credits","balance_usd","available_usd","status","has_payment_method","low_balance_threshold_credits","monthly_spend_cap_credits","spent_this_period_credits","auto_reload","plan"],"title":"WalletResponse"}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Customer API key. Required on every endpoint except the open and session-authenticated routes."},"SessionCookie":{"type":"apiKey","in":"cookie","name":"nebula_access_token","description":"Session cookie set by POST /portal/login."},"SessionBearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Session access token, sent as `Authorization: Bearer <token>`. Obtain it by calling `POST /portal/login` (or `POST /portal/mfa/verify`) with `return_token: true`."}}},"tags":[{"name":"Health","description":"Service health checks"},{"name":"Models","description":"List available OCR models"},{"name":"Uploads","description":"Get presigned S3 URLs for file uploads"},{"name":"Jobs","description":"Create and track OCR jobs"},{"name":"Expense Jobs","description":"Create Spain culture-tax expense-processing jobs"},{"name":"Spread Jobs","description":"Create KSFS spread-processing jobs"},{"name":"Capabilities","description":"Discover workflows enabled for the current API key"},{"name":"Batches","description":"Create and track batch OCR jobs"},{"name":"Custom Prompt","description":"Manage the customer OCR base-prompt override"},{"name":"Usage","description":"Per-account usage metrics and CSV exports"},{"name":"Billing","description":"Credit balance, rate card, cost estimates, and credit-augmented usage"},{"name":"Portal Auth","description":"Create an account and sign in to obtain a session"},{"name":"Portal MFA","description":"Complete login with a TOTP code when MFA is enabled"},{"name":"Portal API Keys","description":"Mint, list, and revoke API keys (session-authenticated)"}],"servers":[{"url":"https://ocr.ur-ai.net","description":"Production"}]}