{"openapi":"3.1.0","info":{"title":"PDF Tools API","description":"Asynchronous PDF processing API. Submit a job, receive a webhook, download the signed result. See https://pdflet.top for the consumer tools.","contact":{"name":"PDFTools","url":"https://pdflet.top/"},"license":{"name":"Proprietary"},"version":"1.0.0"},"paths":{"/v1/jobs":{"post":{"tags":["Jobs"],"summary":"Create a processing job","operationId":"create_job_v1_jobs_post","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJobRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Jobs"],"summary":"List jobs","operationId":"list_jobs_v1_jobs_get","parameters":[{"name":"status_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status Filter"}},{"name":"tool","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"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"}}}}}}},"/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"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/jobs/{job_id}/cancel":{"post":{"tags":["Jobs"],"summary":"Cancel a job","operationId":"cancel_job_v1_jobs__job_id__cancel_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Cancel Job V1 Jobs  Job Id  Cancel Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/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"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/jobs/{job_id}/download":{"get":{"tags":["Jobs"],"summary":"Download the result file","description":"Stream a completed job's output.\n\nAuthorised by **either** a bearer API key (API clients) **or** the signed\n``exp``/``token`` query parameters embedded in ``output.url`` (browsers, which\ncannot attach an ``Authorization`` header to a plain link or ``<a download>``).","operationId":"download_job_v1_jobs__job_id__download_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"exp","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Exp"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/files/upload":{"post":{"tags":["Files"],"summary":"Upload a file","operationId":"upload_file_v1_files_upload_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_file_v1_files_upload_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileUploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/files/content/{key}":{"get":{"tags":["Files"],"summary":"Stored object content (owner only)","description":"Stream a stored object by its storage key.\n\nThis is the URL reported by ``Storage.public_url``. It used to be fully\nunauthenticated, which made every stored upload readable by anyone who could\nreach the API and know (or guess) a key. Access is now scoped to the caller's\nown files, resolved against the ``files`` table, and unknown keys return 404\nso the endpoint cannot be used to probe for stored objects.","operationId":"file_content_v1_files_content__key__get","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/files/{file_id}":{"get":{"tags":["Files"],"summary":"Get file metadata","operationId":"get_file_v1_files__file_id__get","parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"File Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Files"],"summary":"Delete a file","operationId":"delete_file_v1_files__file_id__delete","parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"File Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Delete File V1 Files  File Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tools":{"get":{"tags":["Tools"],"summary":"Tool catalog","operationId":"list_tools_v1_tools_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ToolInfo"},"type":"array","title":"Response List Tools V1 Tools Get"}}}}}}},"/v1/tools/{tool_id}":{"get":{"tags":["Tools"],"summary":"Tool details","operationId":"get_tool_v1_tools__tool_id__get","parameters":[{"name":"tool_id","in":"path","required":true,"schema":{"type":"string","title":"Tool Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolInfo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/models":{"get":{"tags":["Models"],"summary":"List models (OpenAI-compatible)","description":"OpenAI-compatible model catalogue.\n\nThis platform does not host LLM models itself, so the list is empty by\ndefault. The endpoint exists so that OpenAI-style clients probing\n``<origin>/v1/models`` receive a well-formed ``200`` instead of a 404.\nSet ``MODEL_IDS`` (e.g. ``gpt-4o-mini,my-local-llm``) to advertise models\nwhen this API fronts an LLM gateway.","operationId":"list_models_v1_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelList"}}}}}}},"/v1/account":{"get":{"tags":["Account"],"summary":"Account information","operationId":"get_account_v1_account_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/account/usage":{"get":{"tags":["Account"],"summary":"Usage statistics","operationId":"get_usage_v1_account_usage_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/account/limits":{"get":{"tags":["Account"],"summary":"Current limits","operationId":"get_limits_v1_account_limits_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LimitsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/account/invoices":{"get":{"tags":["Account"],"summary":"Invoice list","operationId":"get_invoices_v1_account_invoices_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"array","items":{}},"title":"Response Get Invoices V1 Account Invoices Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks":{"get":{"tags":["Webhooks"],"summary":"List webhooks","operationId":"list_webhooks_v1_webhooks_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookResponse"},"title":"Response List Webhooks V1 Webhooks Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Webhooks"],"summary":"Create a webhook","operationId":"create_webhook_v1_webhooks_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/{webhook_id}":{"delete":{"tags":["Webhooks"],"summary":"Delete a webhook","operationId":"delete_webhook_v1_webhooks__webhook_id__delete","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Webhook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Delete Webhook V1 Webhooks  Webhook Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/{webhook_id}/test":{"post":{"tags":["Webhooks"],"summary":"Send a test event","operationId":"test_webhook_v1_webhooks__webhook_id__test_post","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Webhook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Test Webhook V1 Webhooks  Webhook Id  Test Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/register":{"post":{"tags":["Auth"],"summary":"Create an account","operationId":"register_v1_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/login":{"post":{"tags":["Auth"],"summary":"Sign in","operationId":"login_v1_auth_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/AuthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/forgot-password":{"post":{"tags":["Auth"],"summary":"Request a password reset link","description":"Mail a single-use reset link.\n\nThe response is identical whether or not the address is registered — that\nis the whole point, otherwise this endpoint is an account enumerator.","operationId":"forgot_password_v1_auth_forgot_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordRequest"}}},"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"}}}}}}},"/v1/auth/reset-password":{"post":{"tags":["Auth"],"summary":"Set a new password with a reset token","operationId":"reset_password_v1_auth_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}}},"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"}}}}}}},"/v1/auth/me":{"get":{"tags":["Auth"],"summary":"Current account","operationId":"me_v1_auth_me_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/usage":{"get":{"tags":["Auth"],"summary":"Current account usage","operationId":"usage_v1_auth_usage_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/jobs":{"get":{"tags":["Auth"],"summary":"Your recent jobs","operationId":"recent_jobs_v1_auth_jobs_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"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"}}}}}}},"/v1/keys":{"get":{"tags":["API Keys"],"summary":"List your API keys","operationId":"list_keys_v1_keys_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeyPublic"},"title":"Response List Keys V1 Keys Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["API Keys"],"summary":"Create an API key","operationId":"create_key_v1_keys_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreatedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/keys/{key_id}":{"delete":{"tags":["API Keys"],"summary":"Revoke an API key","operationId":"revoke_key_v1_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Key Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/credits":{"get":{"tags":["Credits"],"summary":"Credit balance and top-up options","operationId":"get_credits_v1_credits_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditsSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/credits/orders":{"post":{"tags":["Credits"],"summary":"Create a top-up order","operationId":"create_order_v1_credits_orders_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditOrderCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditOrderPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/credits/orders/{order_id}/capture":{"post":{"tags":["Credits"],"summary":"Capture an approved PayPal order and credit the wallet","operationId":"capture_order_v1_credits_orders__order_id__capture_post","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Order Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditOrderPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/credits/orders/{order_id}/pay":{"post":{"tags":["Credits"],"summary":"Settle a pending order (mock provider only)","description":"Complete a top-up without a real gateway.\n\nOnly enabled when ``PAYMENT_PROVIDER=mock``, which is a local-development\nconvenience. With ``paypal`` (or ``manual``) settlement must come from\nPayPal itself — otherwise any client could mint itself free credits.","operationId":"pay_order_v1_credits_orders__order_id__pay_post","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Order Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditOrderPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/credits/orders/{order_id}/cancel":{"post":{"tags":["Credits"],"summary":"Cancel a pending order","operationId":"cancel_order_v1_credits_orders__order_id__cancel_post","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Order Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditOrderPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/payments/paypal/webhook":{"post":{"tags":["Payments"],"summary":"PayPal webhook receiver","description":"Settle a top-up from PayPal's own notification.\n\nAlways answers 200 once the signature checks out: PayPal retries any non-2xx\nfor days, and an event we deliberately ignore is not a delivery failure. A\nbad signature is a 400 so the attempt is visible in logs.","operationId":"paypal_webhook_v1_payments_paypal_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Paypal Webhook V1 Payments Paypal Webhook Post"}}}}}}},"/healthz":{"get":{"tags":["Meta"],"summary":"Liveness probe","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Healthz Healthz Get"}}}}}}},"/metrics":{"get":{"tags":["Meta"],"summary":"Prometheus metrics","operationId":"metrics_metrics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AccountResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"email":{"type":"string","title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"plan":{"type":"string","title":"Plan"},"included_credits":{"type":"integer","title":"Included Credits"},"credits_balance":{"type":"integer","title":"Credits Balance"},"region":{"type":"string","title":"Region"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","email","name","plan","included_credits","credits_balance","region","created_at"],"title":"AccountResponse"},"ApiKeyCreateRequest":{"properties":{"name":{"type":"string","maxLength":80,"minLength":1,"title":"Name","default":"Default key"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"}},"type":"object","title":"ApiKeyCreateRequest"},"ApiKeyCreatedResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"key_prefix":{"type":"string","title":"Key Prefix"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"key":{"type":"string","title":"Key"}},"type":"object","required":["id","name","key_prefix","scopes","created_at","key"],"title":"ApiKeyCreatedResponse","description":"Returned once, immediately after creation, with the full secret."},"ApiKeyPublic":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"key_prefix":{"type":"string","title":"Key Prefix"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","name","key_prefix","scopes","created_at"],"title":"ApiKeyPublic","description":"An API key as listed in the dashboard — never includes the secret."},"AuthResponse":{"properties":{"token":{"type":"string","title":"Token"},"token_type":{"type":"string","const":"bearer","title":"Token Type","default":"bearer"},"expires_in":{"type":"integer","title":"Expires In"},"user":{"$ref":"#/components/schemas/UserPublic"}},"type":"object","required":["token","expires_in","user"],"title":"AuthResponse","description":"Returned by register/login: a session token plus the user profile."},"Body_upload_file_v1_files_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_file_v1_files_upload_post"},"CreateJobRequest":{"properties":{"tool":{"type":"string","pattern":"^[a-z0-9-]{3,40}$","title":"Tool"},"input":{"$ref":"#/components/schemas/JobInput"},"options":{"additionalProperties":true,"type":"object","title":"Options"},"webhook_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Webhook Url"},"metadata":{"additionalProperties":{"type":"string"},"type":"object","title":"Metadata"},"expires_in":{"type":"integer","maximum":604800.0,"minimum":3600.0,"title":"Expires In","default":86400}},"type":"object","required":["tool","input"],"title":"CreateJobRequest"},"CreditOrderCreateRequest":{"properties":{"package_id":{"type":"string","maxLength":40,"minLength":1,"title":"Package Id"},"locale":{"anyOf":[{"type":"string","maxLength":10,"pattern":"^[a-z]{2}(-[A-Z]{2})?$"},{"type":"null"}],"title":"Locale"}},"type":"object","required":["package_id"],"title":"CreditOrderCreateRequest"},"CreditOrderPublic":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"package_id":{"type":"string","title":"Package Id"},"credits":{"type":"integer","title":"Credits"},"amount_cents":{"type":"integer","title":"Amount Cents"},"currency":{"type":"string","title":"Currency"},"status":{"type":"string","title":"Status"},"provider":{"type":"string","title":"Provider"},"paid_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paid At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"approve_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approve Url"}},"type":"object","required":["id","package_id","credits","amount_cents","currency","status","provider","created_at"],"title":"CreditOrderPublic"},"CreditPackagePublic":{"properties":{"id":{"type":"string","title":"Id"},"credits":{"type":"integer","title":"Credits"},"amount_cents":{"type":"integer","title":"Amount Cents"},"currency":{"type":"string","title":"Currency"},"recommended":{"type":"boolean","title":"Recommended","default":false}},"type":"object","required":["id","credits","amount_cents","currency"],"title":"CreditPackagePublic"},"CreditsSummary":{"properties":{"balance":{"type":"integer","title":"Balance"},"signup_credits":{"type":"integer","title":"Signup Credits"},"payment_provider":{"type":"string","title":"Payment Provider"},"payments_ready":{"type":"boolean","title":"Payments Ready","default":false},"packages":{"items":{"$ref":"#/components/schemas/CreditPackagePublic"},"type":"array","title":"Packages"},"orders":{"items":{"$ref":"#/components/schemas/CreditOrderPublic"},"type":"array","title":"Orders"}},"type":"object","required":["balance","signup_credits","payment_provider","packages","orders"],"title":"CreditsSummary","description":"Everything the billing tab needs in one round-trip."},"ErrorDetail":{"properties":{"type":{"type":"string","title":"Type"},"code":{"type":"string","title":"Code"},"message":{"type":"string","title":"Message"},"param":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Param"},"doc_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doc Url"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Id"}},"type":"object","required":["type","code","message"],"title":"ErrorDetail"},"FileResponse":{"properties":{"file_id":{"type":"string","format":"uuid","title":"File Id"},"filename":{"type":"string","title":"Filename"},"size_bytes":{"type":"integer","title":"Size Bytes"},"mime_type":{"type":"string","title":"Mime Type"},"pages":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pages"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"}},"type":"object","required":["file_id","filename","size_bytes","mime_type","expires_at"],"title":"FileResponse"},"FileUploadResponse":{"properties":{"file_id":{"type":"string","format":"uuid","title":"File Id"},"filename":{"type":"string","title":"Filename"},"size_bytes":{"type":"integer","title":"Size Bytes"},"mime_type":{"type":"string","title":"Mime Type"},"pages":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pages"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"}},"type":"object","required":["file_id","filename","size_bytes","mime_type","expires_at"],"title":"FileUploadResponse"},"ForgotPasswordRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"ForgotPasswordRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InputType":{"type":"string","enum":["url","file_id"],"title":"InputType"},"JobCreated":{"properties":{"job_id":{"type":"string","title":"Job Id"},"status":{"type":"string","const":"pending","title":"Status","default":"pending"},"tool":{"type":"string","title":"Tool"},"credits_estimated":{"type":"integer","title":"Credits Estimated"},"status_url":{"type":"string","title":"Status Url"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"metadata":{"additionalProperties":{"type":"string"},"type":"object","title":"Metadata"}},"type":"object","required":["job_id","tool","credits_estimated","status_url","created_at","expires_at"],"title":"JobCreated"},"JobInput":{"properties":{"type":{"$ref":"#/components/schemas/InputType"},"url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Url"},"file_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"File Id"},"filename":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Filename"}},"type":"object","required":["type"],"title":"JobInput"},"JobListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/JobResponse"},"type":"array","title":"Items"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["items"],"title":"JobListResponse"},"JobOutput":{"properties":{"url":{"type":"string","title":"Url"},"url_expires_at":{"type":"string","format":"date-time","title":"Url Expires At"},"size_bytes":{"type":"integer","title":"Size Bytes"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"pages":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pages"},"checksum_sha256":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checksum Sha256"}},"type":"object","required":["url","url_expires_at","size_bytes"],"title":"JobOutput"},"JobResponse":{"properties":{"job_id":{"type":"string","title":"Job Id"},"status":{"$ref":"#/components/schemas/JobStatus"},"tool":{"type":"string","title":"Tool"},"credits_estimated":{"type":"integer","title":"Credits Estimated"},"credits_used":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Credits Used"},"output":{"anyOf":[{"$ref":"#/components/schemas/JobOutput"},{"type":"null"}]},"timing":{"anyOf":[{"$ref":"#/components/schemas/JobTiming"},{"type":"null"}]},"error":{"anyOf":[{"$ref":"#/components/schemas/ErrorDetail"},{"type":"null"}]},"metadata":{"additionalProperties":{"type":"string"},"type":"object","title":"Metadata"},"status_url":{"type":"string","title":"Status Url"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"}},"type":"object","required":["job_id","status","tool","credits_estimated","status_url","created_at","expires_at"],"title":"JobResponse"},"JobStatus":{"type":"string","enum":["pending","queued","processing","completed","failed","canceled"],"title":"JobStatus"},"JobTiming":{"properties":{"queued_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Queued Ms"},"processing_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Processing Ms"},"total_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Ms"}},"type":"object","title":"JobTiming"},"LimitsResponse":{"properties":{"plan":{"type":"string","title":"Plan"},"rpm":{"type":"integer","title":"Rpm"},"concurrent":{"type":"integer","title":"Concurrent"},"max_file_mb":{"type":"integer","title":"Max File Mb"},"credits_included":{"type":"integer","title":"Credits Included"},"allow_overage":{"type":"boolean","title":"Allow Overage"}},"type":"object","required":["plan","rpm","concurrent","max_file_mb","credits_included","allow_overage"],"title":"LimitsResponse"},"LoginRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","maxLength":128,"minLength":1,"title":"Password"}},"type":"object","required":["email","password"],"title":"LoginRequest"},"MessageResponse":{"properties":{"message":{"type":"string","title":"Message"},"email_sent":{"type":"boolean","title":"Email Sent","default":true}},"type":"object","required":["message"],"title":"MessageResponse"},"ModelCard":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","title":"Object","default":"model"},"created":{"type":"integer","title":"Created"},"owned_by":{"type":"string","title":"Owned By"}},"type":"object","required":["id","created","owned_by"],"title":"ModelCard"},"ModelList":{"properties":{"object":{"type":"string","title":"Object","default":"list"},"data":{"items":{"$ref":"#/components/schemas/ModelCard"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"ModelList"},"RegisterRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","maxLength":128,"minLength":8,"title":"Password"},"name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Name"}},"type":"object","required":["email","password"],"title":"RegisterRequest"},"ResetPasswordRequest":{"properties":{"token":{"type":"string","maxLength":256,"minLength":16,"title":"Token"},"password":{"type":"string","maxLength":128,"minLength":8,"title":"Password"}},"type":"object","required":["token","password"],"title":"ResetPasswordRequest"},"ToolChoice":{"properties":{"value":{"type":"string","title":"Value"},"label":{"type":"string","title":"Label"}},"type":"object","required":["value","label"],"title":"ToolChoice","description":"One option of a ``select`` input, mirroring ``ToolOptionInput.choices``."},"ToolInfo":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"category":{"type":"string","title":"Category"},"runtime":{"type":"string","title":"Runtime"},"credit_cost":{"type":"integer","title":"Credit Cost"},"accept":{"items":{"type":"string"},"type":"array","title":"Accept"},"min_files":{"type":"integer","title":"Min Files"},"max_files":{"type":"integer","title":"Max Files"},"max_file_size_mb":{"type":"integer","title":"Max File Size Mb"},"options":{"items":{"$ref":"#/components/schemas/ToolOption"},"type":"array","title":"Options"}},"type":"object","required":["id","name","category","runtime","credit_cost","accept","min_files","max_files","max_file_size_mb"],"title":"ToolInfo"},"ToolOption":{"properties":{"name":{"type":"string","title":"Name"},"type":{"type":"string","enum":["select","text","number","password","range","color","toggle"],"title":"Type"},"label":{"type":"string","title":"Label"},"default":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"},{"type":"null"}],"title":"Default"},"choices":{"anyOf":[{"items":{"$ref":"#/components/schemas/ToolChoice"},"type":"array"},{"type":"null"}],"title":"Choices"},"min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min"},"max":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max"},"step":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Step"},"placeholder":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Placeholder"}},"type":"object","required":["name","type","label"],"title":"ToolOption","description":"A user-facing tool parameter.\n\nMirrors ``ToolOptionInput`` in ``packages/shared/src/types.ts`` so that\n``GET /v1/tools`` publishes the same parameter schema the consumer site\nrenders. Before this existed every tool advertised ``options: []``, so an API\nclient could not discover that e.g. ``split-pdf`` takes\n``mode``/``ranges``/``every``."},"UsageResponse":{"properties":{"period_start":{"type":"string","format":"date-time","title":"Period Start"},"period_end":{"type":"string","format":"date-time","title":"Period End"},"credits_used":{"type":"integer","title":"Credits Used"},"credits_included":{"type":"integer","title":"Credits Included"},"jobs_total":{"type":"integer","title":"Jobs Total"},"jobs_completed":{"type":"integer","title":"Jobs Completed"},"jobs_failed":{"type":"integer","title":"Jobs Failed"}},"type":"object","required":["period_start","period_end","credits_used","credits_included","jobs_total","jobs_completed","jobs_failed"],"title":"UsageResponse"},"UserPublic":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"email":{"type":"string","title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"plan":{"type":"string","title":"Plan"},"included_credits":{"type":"integer","title":"Included Credits"},"credits_balance":{"type":"integer","title":"Credits Balance"},"region":{"type":"string","title":"Region"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","email","plan","included_credits","credits_balance","region","created_at"],"title":"UserPublic"},"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"},"WebhookCreate":{"properties":{"url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Url"},"events":{"items":{"type":"string"},"type":"array","title":"Events"}},"type":"object","required":["url"],"title":"WebhookCreate"},"WebhookCreated":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"url":{"type":"string","title":"Url"},"events":{"items":{"type":"string"},"type":"array","title":"Events"},"enabled":{"type":"boolean","title":"Enabled"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"secret":{"type":"string","title":"Secret"}},"type":"object","required":["id","url","events","enabled","created_at","secret"],"title":"WebhookCreated"},"WebhookResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"url":{"type":"string","title":"Url"},"events":{"items":{"type":"string"},"type":"array","title":"Events"},"enabled":{"type":"boolean","title":"Enabled"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","url","events","enabled","created_at"],"title":"WebhookResponse"}}}}