{"components":{"schemas":{"Account":{"additionalProperties":false,"example":{"api_key_id":"key_00000000-0000-4000-8000-000000000001","available_usd":"24.695000000","currency":"usd","funding_enabled":true,"id":"acct_00000000-0000-4000-8000-000000000001","pricing_version":"local-v8-conversion-pages","stripe_test_mode":true},"properties":{"api_key_id":{"description":"Non-secret ID of the currently authenticated key.","type":"string"},"available_usd":{"description":"Signed fixed-decimal USD credit balance. Requests are admitted only while the balance is positive; the final settled charge of an in-flight request may take it below zero until the next top-up. Spending thresholds stop new calls; the last response and its tools can take the final charge beyond them.","example":"0.050000000","pattern":"^-?[0-9]+\\.[0-9]{9}$","type":"string"},"currency":{"const":"usd"},"funding_enabled":{"type":"boolean"},"id":{"type":"string"},"pricing_version":{"type":"string"},"stripe_test_mode":{"type":"boolean"}},"required":["id","currency","available_usd","pricing_version","funding_enabled","stripe_test_mode","api_key_id"],"type":"object"},"AggregatedInferenceUsage":{"additionalProperties":false,"description":"Input includes cached input and cache creation, which are subsets. Output includes reasoning. Includes reported physical turns and compaction. Search units are kept separate across providers.","example":{"cache_creation_input_tokens":0,"cached_input_tokens":2000,"input_tokens":6000,"output_tokens":1000,"web_search_requests_by_unit":{"calls":5,"grounded_prompts":0,"queries":0}},"properties":{"cache_creation_input_tokens":{"example":0,"minimum":0,"type":"integer"},"cached_input_tokens":{"example":2000,"minimum":0,"type":"integer"},"input_tokens":{"example":6000,"minimum":0,"type":"integer"},"output_tokens":{"example":1000,"minimum":0,"type":"integer"},"web_search_requests_by_unit":{"additionalProperties":false,"example":{"calls":5,"grounded_prompts":0,"queries":0},"properties":{"calls":{"minimum":0,"type":"integer"},"grounded_prompts":{"minimum":0,"type":"integer"},"queries":{"minimum":0,"type":"integer"}},"required":["calls","queries","grounded_prompts"],"type":"object"}},"required":["input_tokens","cached_input_tokens","cache_creation_input_tokens","output_tokens","web_search_requests_by_unit"],"type":"object"},"Artifact":{"additionalProperties":false,"properties":{"bytes":{"description":"Size of the downloadable bytes, including JWE encoding overhead when encrypted.","type":"integer"},"content_type":{"description":"Original plaintext MIME type. Encrypted downloads use application/jose.","type":"string"},"conversion_id":{"type":"string"},"deleted_at":{"format":"date-time","type":["string","null"]},"download_url":{"description":"Account-authenticated API path. The endpoint may redirect to signed storage; never forward bearer credentials to storage.","type":"string"},"encryption":{"$ref":"#/components/schemas/ArtifactEncryption"},"expires_at":{"format":"date-time","type":["string","null"]},"filename":{"description":"Original plaintext filename, even when encrypted. Encrypted downloads append .jwe.","type":"string"},"format":{"enum":["docx","pdf","md","html","txt"]},"id":{"type":"string"},"input_eligible":{"description":"True only for an unexpired, undeleted, unencrypted prompt artifact. Conversion artifacts are not directly reusable; download and upload them first.","type":"boolean"},"prompt_id":{"type":"string"},"sha256":{"description":"SHA-256 of the exact downloadable bytes (ciphertext for encrypted artifacts).","type":"string"},"variant":{"enum":["tracked_changes","clean","converted"]}},"required":["id","format","filename","content_type","variant","sha256","bytes","download_url","input_eligible","expires_at","deleted_at"],"type":"object"},"ArtifactEncryption":{"additionalProperties":false,"properties":{"alg":{"enum":["RSA-OAEP-256"],"type":"string"},"enc":{"enum":["A256GCM"],"type":"string"},"format":{"enum":["jwe"],"type":"string"},"key_id":{"description":"Base64url SHA-256 JWK thumbprint of the recipient public key (RFC7638).","type":"string"}},"required":["format","alg","enc","key_id"],"type":"object"},"Citation":{"additionalProperties":false,"properties":{"endIndex":{"type":"integer"},"id":{"type":"string"},"startIndex":{"type":"integer"},"title":{"type":"string"},"url":{"type":"string"}},"required":["id","url","title"],"type":"object"},"Continuation":{"additionalProperties":false,"properties":{"history_compacted":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"reason":{"type":"string"},"reasoning_state":{"enum":["new","reused","reset","compacted","unavailable"]}},"required":["reasoning_state","history_compacted"],"type":"object"},"Conversion":{"additionalProperties":true,"properties":{"completed_at":{"format":"date-time","type":["string","null"]},"content_deleted_at":{"format":"date-time","type":["string","null"]},"content_expires_at":{"format":"date-time","type":["string","null"]},"created_at":{"format":"date-time","type":"string"},"error":{"anyOf":[{"additionalProperties":false,"properties":{"code":{"type":"string"},"details":{"additionalProperties":true,"type":"object"},"message":{"type":"string"}},"required":["code","message"],"type":"object"},{"type":"null"}]},"id":{"type":"string"},"input":{"properties":{"bytes":{"type":"integer"},"file_id":{"type":"string"},"filename":{"type":"string"},"format":{"description":"Empty after request content has been deleted.","enum":["pdf","docx","md","html","txt","rtf","odt","image",""]},"sha256":{"type":"string"}},"required":["file_id","format","filename","bytes","sha256"],"type":"object"},"metadata":{"$ref":"#/components/schemas/Metadata"},"mode":{"description":"Empty after request content has been deleted.","enum":["deterministic","vision",""]},"object":{"const":"conversion"},"output":{"properties":{"artifact":{"anyOf":[{"$ref":"#/components/schemas/Artifact"},{"type":"null"}]},"format":{"description":"Empty after request content has been deleted.","enum":["docx","pdf","md","html","txt",""]}},"required":["format","artifact"],"type":"object"},"output_encrypted":{"type":"boolean"},"retention":{"$ref":"#/components/schemas/RetentionOptions"},"status":{"enum":["queued","running","succeeded","failed","cancelled"]},"usage":{"anyOf":[{"$ref":"#/components/schemas/Usage"},{"type":"null"}]}},"required":["id","object","status","mode","input","output","metadata","created_at","output_encrypted","usage","completed_at","content_expires_at","content_deleted_at","error"],"type":"object"},"ConversionRequest":{"additionalProperties":false,"properties":{"inference":{"$ref":"#/components/schemas/InferenceRequest"},"input":{"additionalProperties":false,"properties":{"file_id":{"type":"string"}},"required":["file_id"],"type":"object"},"limits":{"$ref":"#/components/schemas/Limits"},"metadata":{"$ref":"#/components/schemas/Metadata"},"output":{"additionalProperties":false,"properties":{"format":{"enum":["docx","pdf","md","html","txt"]}},"required":["format"],"type":"object"},"output_encryption":{"$ref":"#/components/schemas/OutputEncryption"},"retention":{"$ref":"#/components/schemas/RetentionOptions"}},"required":["input","output"],"type":"object"},"Cost":{"additionalProperties":false,"description":"Settled customer charges. Itemized base, CPU and inference fees are disjoint and sum exactly to total_usd. Inference includes model processing and web search. No overlapping platform subtotal. Balances and limits are separate from cost.","example":{"itemized":{"base_fee_usd":"0.250000000","cpu_fee_usd":"0.005000000","inference_fee_usd":"0.050000000"},"total_usd":"0.305000000"},"properties":{"itemized":{"additionalProperties":false,"properties":{"base_fee_usd":{"example":"0.250000000","pattern":"^[0-9]+\\.[0-9]{9}$","type":"string"},"cpu_fee_usd":{"example":"0.005000000","pattern":"^[0-9]+\\.[0-9]{9}$","type":"string"},"inference_fee_usd":{"example":"0.050000000","pattern":"^[0-9]+\\.[0-9]{9}$","type":"string"}},"required":["base_fee_usd","cpu_fee_usd","inference_fee_usd"],"type":"object"},"total_usd":{"example":"0.305000000","pattern":"^[0-9]+\\.[0-9]{9}$","type":"string"}},"required":["total_usd","itemized"],"type":"object"},"Error":{"additionalProperties":false,"properties":{"error":{"additionalProperties":false,"properties":{"code":{"type":"string"},"details":{"additionalProperties":true,"type":"object"},"message":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"},"File":{"additionalProperties":false,"properties":{"bytes":{"type":"integer"},"created_at":{"format":"date-time","type":"string"},"deleted_at":{"format":"date-time","type":["string","null"]},"expires_at":{"format":"date-time","type":["string","null"]},"filename":{"description":"Empty once expired or deleted.","type":"string"},"id":{"type":"string"},"lifetime":{"enum":["ephemeral","persistent"],"type":"string"},"sha256":{"type":"string"},"status":{"enum":["uploaded","expired","deleted"],"type":"string"}},"required":["id","filename","bytes","sha256","status","created_at","expires_at","lifetime","deleted_at"],"type":"object"},"FundingOrder":{"additionalProperties":false,"properties":{"amount_cents":{"type":"integer"},"automatic":{"type":"boolean"},"created_at":{"format":"date-time","type":"string"},"id":{"type":"string"},"status":{"enum":["pending","succeeded","failed","needs_reconciliation","requires_action"]}},"required":["id","amount_cents","automatic","status","created_at"],"type":"object"},"InferenceRequest":{"additionalProperties":false,"properties":{"billing":{"description":"Which party pays for inference. Omitted or \"revise\" is automatic: the account's stored key for the resolved provider is used when present (billed by the provider, no Revise inference charge), otherwise managed inference applies. \"provider\" requires a stored key for the resolved provider and fails admission with provider_key_required instead of falling back. Provider resolution includes defaults and predecessor inheritance, so an omitted provider still uses the account key.","enum":["revise","provider"]},"model":{"description":"Exact model ID from /v1/models, or default. Omitting it selects the provider default, except when inherited from a predecessor.","type":"string"},"provider":{"description":"Public provider ID. Omit for the API default on a new conversation, or inherit from previous_prompt_id.","enum":["openai","anthropic","xai","gemini"]}},"required":[],"type":"object"},"Ledger":{"additionalProperties":false,"properties":{"data":{"items":{"additionalProperties":false,"properties":{"available_delta_usd":{"description":"Signed net change to the credit balance for this entry. Historical reservation holds and their releases net to zero.","example":"0.050000000","pattern":"^-?[0-9]+\\.[0-9]{9}$","type":"string"},"conversion_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Conversion linked to this entry, or null. Follow with GET /v1/convert/{id}; prompt_id is null for conversion entries."},"created_at":{"format":"date-time","type":"string"},"id":{"type":"integer"},"kind":{"type":"string"},"prompt_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Prompt linked to this entry, or null. Follow with GET /v1/prompt/{id}; conversion_id is null for prompt entries. Both IDs are null for funding entries."}},"required":["id","kind","prompt_id","conversion_id","available_delta_usd","created_at"],"type":"object"},"type":"array"},"limit":{"const":50}},"required":["data","limit"],"type":"object"},"Limits":{"additionalProperties":false,"description":"Optional execution and spending thresholds. Spending limits are opt-in: omitted cost limits are unlimited. The time limit defaults to 900 seconds. Prompt platform cost is base fee plus tool CPU; conversion platform cost is its flat/page fee. Prompt cost limits may each be at most $500,000; conversion cost limits may each be at most $1,000,000. These thresholds do not reserve account credit.","example":{"max_inference_cost_usd":"3.000000000","max_platform_cost_usd":"2.000000000","max_seconds":900},"properties":{"max_inference_cost_usd":{"description":"Soft inference threshold, including managed prompt premium and search. Active responses can exceed it. With your own provider key it meters provider list-price spend, while Revise charges no inference fee. For managed scans, scan inference is included in the page fee but remains subject to this threshold. Omit for no per-request spending limit. Must be greater than zero when supplied.","oneOf":[{"pattern":"^(?=[0-9.]*[1-9])[0-9]+(\\.[0-9]{1,9})?$","type":"string"},{"exclusiveMinimum":0,"maximum":1000000,"type":"number"}]},"max_platform_cost_usd":{"description":"Platform spending threshold. Must cover the applicable base/conversion fee, or one scan page. A scan checks its full page fee before inference. For prompts, no new model call starts once observed platform spend reaches this threshold; active work may exceed it. Omit for no per-request spending limit. Must be greater than zero when supplied.","oneOf":[{"pattern":"^(?=[0-9.]*[1-9])[0-9]+(\\.[0-9]{1,9})?$","type":"string"},{"exclusiveMinimum":0,"maximum":1000000,"type":"number"}]},"max_seconds":{"default":900,"description":"Work budget in seconds, starting when a worker begins, excluding queue time. Prompts stop new turns at the deadline; active responses and exports can finish later.","maximum":3600,"minimum":120,"type":"integer"}},"required":[],"type":"object"},"Message":{"additionalProperties":false,"properties":{"citations":{"items":{"$ref":"#/components/schemas/Citation"},"type":"array"},"content":{"type":"string"},"incomplete":{"type":"boolean"},"role":{"const":"assistant"}},"required":["role","content","incomplete"],"type":"object"},"Metadata":{"additionalProperties":{"maxLength":512,"type":"string"},"description":"Up to 16 string values for application attribution. Keys are 1–64 UTF-8 bytes; values at most 512 UTF-8 bytes. Metadata is deleted with request content; persist your own job mapping for long-term attribution.","example":{"customer":"acme","environment":"production"},"maxProperties":16,"propertyNames":{"maxLength":64,"minLength":1},"type":"object"},"Model":{"additionalProperties":false,"properties":{"default_for_provider":{"example":true,"type":"boolean"},"id":{"example":"gpt-6-luna","type":"string"},"name":{"example":"GPT-6 Luna","type":"string"},"provider":{"enum":["openai","anthropic","xai","gemini"],"type":"string"}},"required":["id","provider","name","default_for_provider"],"type":"object"},"ModelList":{"additionalProperties":false,"example":{"data":[{"default_for_provider":true,"id":"gpt-6-luna","name":"GPT-6 Luna","provider":"openai"}],"default":{"model":"gpt-6-luna","provider":"openai"}},"properties":{"data":{"items":{"$ref":"#/components/schemas/Model"},"type":"array"},"default":{"additionalProperties":false,"properties":{"model":{"type":"string"},"provider":{"enum":["openai","anthropic","xai","gemini"],"type":"string"}},"required":["provider","model"],"type":"object"}},"required":["data","default"],"type":"object"},"NativeComment":{"additionalProperties":true,"description":"Flat native comment record. Replies use parentId. Anchors are carried in the document, with anchorBlockId available for structural anchors. Native fields retain camelCase.","properties":{"agentConversationId":{"type":"string"},"agentModel":{"type":"string"},"agentName":{"type":"string"},"agentRequestId":{"type":"string"},"agentTriggerIds":{"items":{"type":"string"},"type":"array"},"anchorBlockId":{"type":"string"},"author":{"type":"string"},"authorId":{"type":"string"},"authorImageUrl":{"type":"string"},"authorType":{"enum":["human","ai"]},"bodyMd":{"description":"Comment text in Markdown.","type":"string"},"citations":{"items":{"$ref":"#/components/schemas/Citation"},"type":"array"},"createdAt":{"format":"date-time","type":"string"},"id":{"type":"string"},"importedId":{"type":"integer"},"initials":{"type":"string"},"mentions":{"items":{"additionalProperties":true,"properties":{"email":{"type":"string"},"end":{"type":"integer"},"id":{"type":"string"},"label":{"type":"string"},"start":{"type":"integer"},"type":{"enum":["user","agent"]}},"required":["id","type","label","start","end"],"type":"object"},"type":"array"},"parentId":{"description":"Parent comment ID for a reply; absent for a root comment.","type":"string"},"relatedSuggestionIds":{"items":{"type":"string"},"type":"array"},"resolved":{"type":"boolean"},"suggestionId":{"type":"string"}},"required":["id","author","createdAt","bodyMd"],"type":"object"},"NativeCommentThread":{"allOf":[{"$ref":"#/components/schemas/NativeComment"}],"deprecated":true,"description":"Deprecated name. Prompt comments are flat NativeComment records, not grouped threads. Use NativeComment."},"NativeTrackedChange":{"additionalProperties":true,"description":"Pending tracked change with native camelCase fields. May include revisions already present in the input.","properties":{"agentModel":{"type":"string"},"author":{"type":"string"},"authorType":{"enum":["human","ai"]},"blockIds":{"items":{"type":"string"},"type":"array"},"commentThreadId":{"type":"string"},"createdAt":{"description":"Unix time in milliseconds, when recorded.","type":"number"},"deletedText":{"type":"string"},"description":{"type":"string"},"id":{"type":"string"},"insertedText":{"type":"string"},"kind":{"enum":["insert","delete","format","move"]},"moveDestinationBlockIds":{"items":{"type":"string"},"type":"array"},"moveSourceBlockIds":{"items":{"type":"string"},"type":"array"}},"required":["id","kind","author","authorType","blockIds"],"type":"object"},"OutputEncryption":{"additionalProperties":false,"description":"Encrypt exported artifact bytes using compact JWE, RSA-OAEP-256 and A256GCM. Only encrypted files are downloadable. Disables prompt continuation and artifact reuse; cannot be combined with previous_prompt_id or artifact_id input. Prompts require editing or export_document=true.","properties":{"format":{"enum":["jwe"],"type":"string"},"public_key_pem":{"description":"RSA SubjectPublicKeyInfo PEM (BEGIN PUBLIC KEY), 2048–8192 bits. Private keys, certificates and key URLs are rejected.","maxLength":16384,"type":"string"}},"required":["format","public_key_pem"],"type":"object"},"Prompt":{"additionalProperties":false,"properties":{"api_key_id":{"description":"Non-secret ID of the key that originally submitted this prompt; null when not recorded. Idempotent retries preserve the original key.","type":["string","null"]},"artifacts":{"items":{"$ref":"#/components/schemas/Artifact"},"type":"array"},"changes":{"description":"Pending native tracked changes. Replacements can appear as linked insertion/deletion entries. Omitted when disabled by response_options or when content is unavailable.","items":{"$ref":"#/components/schemas/NativeTrackedChange"},"type":"array"},"comments":{"description":"Flat native comment records; replies use parentId. Omitted when disabled by response_options or when content is unavailable.","items":{"$ref":"#/components/schemas/NativeComment"},"type":"array"},"completed_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"content_deleted_at":{"format":"date-time","type":["string","null"]},"content_expires_at":{"description":"24 hours after terminal completion. Result content and new continuation become unavailable at this deadline.","format":"date-time","type":["string","null"]},"continuation":{"$ref":"#/components/schemas/Continuation"},"conversation_expires_at":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"conversation_id":{"type":"string"},"created_at":{"format":"date-time","type":"string"},"error":{"anyOf":[{"additionalProperties":false,"properties":{"code":{"type":"string"},"details":{"additionalProperties":true,"type":"object"},"message":{"type":"string"}},"required":["code","message"],"type":"object"},{"type":"null"}]},"id":{"type":"string"},"incomplete":{"description":"True when the request returned a partial result.","type":"boolean"},"inference":{"additionalProperties":false,"properties":{"billing":{"description":"The billing that applied at admission; fixed for the life of the request even if account keys change later.","enum":["revise","provider"]},"model":{"type":"string"},"provider":{"enum":["openai","anthropic","xai","gemini"]}},"required":["provider","model","billing"],"type":"object"},"limits":{"additionalProperties":false,"properties":{"max_inference_cost_usd":{"example":"0.050000000","pattern":"^-?[0-9]+\\.[0-9]{9}$","type":"string"},"max_platform_cost_usd":{"example":"0.050000000","pattern":"^-?[0-9]+\\.[0-9]{9}$","type":"string"},"max_seconds":{"type":"integer"}},"required":["max_seconds"],"type":"object"},"message":{"anyOf":[{"$ref":"#/components/schemas/Message"},{"type":"null"}]},"metadata":{"$ref":"#/components/schemas/Metadata"},"output_encrypted":{"description":"True disables continuation and reuse. Artifacts are encrypted for the supplied public key.","type":"boolean"},"previous_prompt_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"retention":{"$ref":"#/components/schemas/RetentionOptions"},"status":{"enum":["queued","running","paused","succeeded","failed","cancelled"]},"stop_reason":{"description":"Limit that ended further agent work. The current result is returned; successful partial results incur the base fee even without inference, plus actual billable usage.","enum":["spending_limit","time_limit"],"type":"string"},"usage":{"anyOf":[{"$ref":"#/components/schemas/Usage"},{"type":"null"}]}},"required":["id","conversation_id","previous_prompt_id","status","created_at","completed_at","conversation_expires_at","message","continuation","artifacts","usage","metadata","inference","limits","error","api_key_id","output_encrypted","incomplete","content_expires_at","content_deleted_at"],"type":"object"},"PromptRequest":{"additionalProperties":false,"description":"Submit text-only work or one document target. comment/edit access and export require a document. Native web search is enabled. The resolved provider credential is pinned at submission; replacing or deleting it can fail the next model call without managed fallback. See the guides for pricing, continuation, and retention.","example":{"document_access":"read","metadata":{"customer":"acme","environment":"development"},"prompt":"Rewrite this paragraph in a clear, professional tone: We got your request and will get back to you soon."},"properties":{"document_access":{"default":"read","enum":["read","comment","edit"]},"export_document":{"default":false,"description":"Export clean and tracked-changes DOCX artifacts for read/comment requests. edit always exports. Requires a target.","type":"boolean"},"inference":{"$ref":"#/components/schemas/InferenceRequest"},"inputs":{"description":"At most one target, with exactly one file_id or artifact_id. Uploaded targets support DOCX, Markdown, HTML, and text. Direct artifact inputs require input_eligible=true and an unencrypted new request.","items":{"$ref":"#/components/schemas/Target"},"maxItems":1,"type":"array"},"limits":{"$ref":"#/components/schemas/Limits"},"metadata":{"$ref":"#/components/schemas/Metadata"},"output_encryption":{"$ref":"#/components/schemas/OutputEncryption"},"previous_prompt_id":{"description":"Latest successful head of the same conversation, with retained content and no active successor. Cannot be combined with inputs. Inherits provider/model and omitted response options; document_access still defaults to read. Encrypted-output requests cannot be continued.","type":"string"},"prompt":{"description":"Nonempty instruction, at most 1 MiB of UTF-8 bytes. The entire JSON body is limited to 2 MiB.","maxLength":1048576,"minLength":1,"type":"string"},"response_options":{"$ref":"#/components/schemas/ResponseOptions"},"retention":{"$ref":"#/components/schemas/RetentionOptions"}},"required":["prompt"],"type":"object"},"ResponseOptions":{"additionalProperties":false,"description":"Persisted response policy. False omits the corresponding top-level JSON field from submission, polling, history and replay responses; it does not change the document or native state. Omitted options inherit from an unencrypted predecessor or reused artifact, otherwise default to true.","properties":{"include_changes":{"default":true,"type":"boolean"},"include_comments":{"default":true,"type":"boolean"}},"type":"object"},"RetentionOptions":{"additionalProperties":false,"properties":{"delete_after_webhook_id":{"description":"Account-owned endpoint subscribed to prompt.completed or conversion.completed, matching the request kind. Its successful acknowledgement deletes request content and ephemeral source. Download everything before returning 2xx.","pattern":"^wh_[0-9a-f-]{36}$","type":"string"}},"required":["delete_after_webhook_id"],"type":"object"},"Target":{"additionalProperties":false,"oneOf":[{"not":{"required":["artifact_id"]},"required":["file_id"]},{"not":{"required":["file_id"]},"required":["artifact_id"]}],"properties":{"artifact_id":{"type":"string"},"file_id":{"type":"string"},"role":{"const":"target"}},"required":["role"],"type":"object"},"Usage":{"additionalProperties":false,"description":"Customer-facing settled charges and usage. Supplier costs, margins and internal reconciliation diagnostics are not exposed. Historical charges are never recalculated using current prices.","example":{"cost":{"itemized":{"base_fee_usd":"0.050000000","cpu_fee_usd":"0.050000000","inference_fee_usd":"0.010000000"},"total_usd":"0.110000000"},"inference":{"billed_by":"revise","cache_creation_input_tokens":0,"cached_input_tokens":400,"input_tokens":1200,"output_tokens":200,"web_search_requests":1,"web_search_unit":"calls"},"platform":{"tool_cpu_rate_usd_per_second":"0.050000000","tool_cpu_seconds":"1.000000"},"pricing_version":"local-v8-conversion-pages"},"properties":{"conversion":{"additionalProperties":false,"description":"Conversion billing details retained after content deletion. For billed work, base_fee_usd is quantity × unit_price_usd (historical word pricing applies a minimum). Read settled cost for the actual charge.","properties":{"minimum_fee_usd":{"description":"Only present for unit word.","pattern":"^-?[0-9]+\\.[0-9]{9}$","type":"string"},"quantity":{"description":"Units billed: 1 (or 0 if unbilled) for conversion, scanned pages for page, output words for word.","minimum":0,"type":"integer"},"unit":{"description":"conversion: flat fee for a non-scanned input. page: PDF/image pages actually scanned. word: only on conversions admitted under the superseded local-v7-conversion-words pricing.","enum":["conversion","page","word"]},"unit_price_usd":{"example":"0.020000000","pattern":"^-?[0-9]+\\.[0-9]{9}$","type":"string"}},"required":["unit","quantity","unit_price_usd"],"type":"object"},"cost":{"$ref":"#/components/schemas/Cost"},"inference":{"additionalProperties":false,"description":"Includes model input, cache reads/writes, output and reasoning, compaction, and native web/X search or Google grounding. Search units depend on provider. Provider-reported usage counts are omitted on older receipts. For conversions, managed scan inference is included in the per-page conversion fee, so inference_fee_usd is zero. Aggregate token counts do not imply a single inference rate; historical per-category rates are not available in this receipt.","properties":{"billed_by":{"description":"\"provider\" when the account's own key paid the supplier: inference_fee_usd is then zero, token counts are still reported, and no supplier amount is exposed.","enum":["revise","provider"]},"cache_creation_input_tokens":{"minimum":0,"type":"integer"},"cached_input_tokens":{"minimum":0,"type":"integer"},"input_tokens":{"minimum":0,"type":"integer"},"output_tokens":{"minimum":0,"type":"integer"},"web_search_requests":{"minimum":0,"type":"integer"},"web_search_unit":{"enum":["calls","queries","grounded_prompts"],"type":"string"}},"required":["billed_by"],"type":"object"},"platform":{"additionalProperties":false,"properties":{"tool_cpu_rate_usd_per_second":{"example":"0.050000000","pattern":"^-?[0-9]+\\.[0-9]{9}$","type":"string"},"tool_cpu_seconds":{"example":"1.250000","pattern":"^[0-9]+\\.[0-9]{6}$","type":"string"}},"required":["tool_cpu_seconds","tool_cpu_rate_usd_per_second"],"type":"object"},"pricing_version":{"type":"string"}},"required":["pricing_version","platform","inference","cost"],"type":"object"},"UsageBucket":{"additionalProperties":false,"description":"Only occupied buckets are returned. Bounds are clipped to the requested interval. Both bounds are null for bucket=none. Missing dimension values are null, distinct from empty strings.","example":{"bucket_end":"2026-09-07T00:00:00Z","bucket_start":"2026-09-06T00:00:00Z","cost":{"itemized":{"base_fee_usd":"0.100000000","cpu_fee_usd":"0.100000000","inference_fee_usd":"0.020000000"},"total_usd":"0.220000000"},"dimensions":{"metadata.customer":"acme"},"inference_usage":{"cache_creation_input_tokens":0,"cached_input_tokens":800,"input_tokens":2400,"output_tokens":400,"web_search_requests_by_unit":{"calls":2,"grounded_prompts":0,"queries":0}},"request_count":2,"tool_cpu_seconds":"2.000000"},"properties":{"bucket_end":{"example":"2026-09-07T00:00:00Z","format":"date-time","type":["string","null"]},"bucket_start":{"example":"2026-09-06T00:00:00Z","format":"date-time","type":["string","null"]},"cost":{"$ref":"#/components/schemas/Cost"},"dimensions":{"additionalProperties":{"type":["string","null"]},"example":{"metadata.customer":"acme"},"maxProperties":3,"type":"object"},"inference_usage":{"anyOf":[{"$ref":"#/components/schemas/AggregatedInferenceUsage"},{"type":"null"}],"description":"Null if any receipt in this aggregate lacks inference counters; charge totals remain complete. Empty aggregates have zero counters.","example":{"cache_creation_input_tokens":0,"cached_input_tokens":800,"input_tokens":2400,"output_tokens":400,"web_search_requests_by_unit":{"calls":2,"grounded_prompts":0,"queries":0}}},"request_count":{"example":2,"minimum":0,"type":"integer"},"tool_cpu_seconds":{"example":"2.000000","pattern":"^[0-9]+\\.[0-9]{6}$","type":"string"}},"required":["bucket_start","bucket_end","dimensions","request_count","tool_cpu_seconds","inference_usage","cost"],"type":"object"},"UsageReport":{"additionalProperties":false,"example":{"bucket":"day","data":[{"bucket_end":"2026-09-07T00:00:00Z","bucket_start":"2026-09-06T00:00:00Z","cost":{"itemized":{"base_fee_usd":"0.100000000","cpu_fee_usd":"0.100000000","inference_fee_usd":"0.020000000"},"total_usd":"0.220000000"},"dimensions":{"metadata.customer":"acme"},"inference_usage":{"cache_creation_input_tokens":0,"cached_input_tokens":800,"input_tokens":2400,"output_tokens":400,"web_search_requests_by_unit":{"calls":2,"grounded_prompts":0,"queries":0}},"request_count":2,"tool_cpu_seconds":"2.000000"},{"bucket_end":"2026-09-08T00:00:00Z","bucket_start":"2026-09-07T00:00:00Z","cost":{"itemized":{"base_fee_usd":"0.150000000","cpu_fee_usd":"0.150000000","inference_fee_usd":"0.030000000"},"total_usd":"0.330000000"},"dimensions":{"metadata.customer":"acme"},"inference_usage":{"cache_creation_input_tokens":0,"cached_input_tokens":1200,"input_tokens":3600,"output_tokens":600,"web_search_requests_by_unit":{"calls":3,"grounded_prompts":0,"queries":0}},"request_count":3,"tool_cpu_seconds":"3.000000"}],"end":"2026-09-08T00:00:00Z","group_by":["metadata.customer"],"start":"2026-09-06T00:00:00Z","time_basis":"completed_at","totals":{"cost":{"itemized":{"base_fee_usd":"0.250000000","cpu_fee_usd":"0.250000000","inference_fee_usd":"0.050000000"},"total_usd":"0.550000000"},"inference_usage":{"cache_creation_input_tokens":0,"cached_input_tokens":2000,"input_tokens":6000,"output_tokens":1000,"web_search_requests_by_unit":{"calls":5,"grounded_prompts":0,"queries":0}},"request_count":5,"tool_cpu_seconds":"5.000000"}},"properties":{"bucket":{"enum":["hour","day","month","none"],"example":"day"},"data":{"example":[{"bucket_end":"2026-09-07T00:00:00Z","bucket_start":"2026-09-06T00:00:00Z","cost":{"itemized":{"base_fee_usd":"0.100000000","cpu_fee_usd":"0.100000000","inference_fee_usd":"0.020000000"},"total_usd":"0.220000000"},"dimensions":{"metadata.customer":"acme"},"inference_usage":{"cache_creation_input_tokens":0,"cached_input_tokens":800,"input_tokens":2400,"output_tokens":400,"web_search_requests_by_unit":{"calls":2,"grounded_prompts":0,"queries":0}},"request_count":2,"tool_cpu_seconds":"2.000000"},{"bucket_end":"2026-09-08T00:00:00Z","bucket_start":"2026-09-07T00:00:00Z","cost":{"itemized":{"base_fee_usd":"0.150000000","cpu_fee_usd":"0.150000000","inference_fee_usd":"0.030000000"},"total_usd":"0.330000000"},"dimensions":{"metadata.customer":"acme"},"inference_usage":{"cache_creation_input_tokens":0,"cached_input_tokens":1200,"input_tokens":3600,"output_tokens":600,"web_search_requests_by_unit":{"calls":3,"grounded_prompts":0,"queries":0}},"request_count":3,"tool_cpu_seconds":"3.000000"}],"items":{"$ref":"#/components/schemas/UsageBucket"},"maxItems":1000,"type":"array"},"end":{"example":"2026-09-08T00:00:00Z","format":"date-time","type":"string"},"group_by":{"example":["metadata.customer"],"items":{"type":"string"},"maxItems":3,"type":"array","uniqueItems":true},"start":{"example":"2026-09-06T00:00:00Z","format":"date-time","type":"string"},"time_basis":{"const":"completed_at","example":"completed_at"},"totals":{"$ref":"#/components/schemas/UsageTotals","example":{"cost":{"itemized":{"base_fee_usd":"0.250000000","cpu_fee_usd":"0.250000000","inference_fee_usd":"0.050000000"},"total_usd":"0.550000000"},"inference_usage":{"cache_creation_input_tokens":0,"cached_input_tokens":2000,"input_tokens":6000,"output_tokens":1000,"web_search_requests_by_unit":{"calls":5,"grounded_prompts":0,"queries":0}},"request_count":5,"tool_cpu_seconds":"5.000000"}}},"required":["start","end","time_basis","bucket","group_by","totals","data"],"type":"object"},"UsageTotals":{"additionalProperties":false,"example":{"cost":{"itemized":{"base_fee_usd":"0.250000000","cpu_fee_usd":"0.250000000","inference_fee_usd":"0.050000000"},"total_usd":"0.550000000"},"inference_usage":{"cache_creation_input_tokens":0,"cached_input_tokens":2000,"input_tokens":6000,"output_tokens":1000,"web_search_requests_by_unit":{"calls":5,"grounded_prompts":0,"queries":0}},"request_count":5,"tool_cpu_seconds":"5.000000"},"properties":{"cost":{"$ref":"#/components/schemas/Cost"},"inference_usage":{"anyOf":[{"$ref":"#/components/schemas/AggregatedInferenceUsage"},{"type":"null"}],"description":"Null if any receipt in this aggregate lacks inference counters; charge totals remain complete. Empty aggregates have zero counters.","example":{"cache_creation_input_tokens":0,"cached_input_tokens":2000,"input_tokens":6000,"output_tokens":1000,"web_search_requests_by_unit":{"calls":5,"grounded_prompts":0,"queries":0}}},"request_count":{"example":5,"minimum":0,"type":"integer"},"tool_cpu_seconds":{"example":"5.000000","pattern":"^[0-9]+\\.[0-9]{6}$","type":"string"}},"required":["request_count","tool_cpu_seconds","inference_usage","cost"],"type":"object"},"Webhook":{"additionalProperties":false,"properties":{"created_at":{"example":"2026-09-08T12:00:00Z","format":"date-time","type":"string"},"deleted_at":{"example":null,"format":"date-time","type":["string","null"]},"events":{"example":["prompt.completed","prompt.failed"],"items":{"enum":["prompt.completed","prompt.failed","prompt.cancelled","prompt.paused","conversion.completed","conversion.failed","conversion.cancelled"],"type":"string"},"maxItems":7,"minItems":1,"type":"array","uniqueItems":true},"id":{"example":"wh_21ff52db-63f9-4a1c-a1ab-8d1a9f11c201","type":"string"},"signing_secret":{"description":"Returned only on creation and its idempotent replay. Store securely.","example":"whsec_AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8=","type":"string"},"url":{"example":"https://example.com/webhooks/revise","format":"uri","type":"string"}},"required":["id","url","events","created_at","deleted_at"],"type":"object"},"WebhookDelivery":{"additionalProperties":false,"properties":{"attempts":{"example":2,"minimum":0,"type":"integer"},"created_at":{"example":"2026-09-08T12:00:00Z","format":"date-time","type":"string"},"delivered_at":{"example":null,"format":"date-time","type":["string","null"]},"event_id":{"example":"evt_b70793a8-0a0c-4e8f-827d-f1ddba77703f","type":"string"},"event_type":{"example":"prompt.completed","type":"string"},"id":{"example":"del_36106431-4db2-459a-92d9-08ce744d5aac","type":"string"},"last_error":{"example":"http_error","type":["string","null"]},"last_http_status":{"example":503,"type":["integer","null"]},"next_attempt_at":{"example":"2026-09-08T12:02:00Z","format":"date-time","type":["string","null"]},"status":{"enum":["pending","sending","delivered","exhausted","cancelled"],"example":"pending","type":"string"}},"required":["id","event_id","event_type","status","attempts","next_attempt_at","last_http_status","last_error","created_at","delivered_at"],"type":"object"},"WebhookDeliveryList":{"additionalProperties":false,"properties":{"data":{"items":{"$ref":"#/components/schemas/WebhookDelivery"},"type":"array"},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"type":"object"},"WebhookList":{"additionalProperties":false,"properties":{"data":{"items":{"$ref":"#/components/schemas/Webhook"},"type":"array"}},"required":["data"],"type":"object"},"WebhookRetry":{"additionalProperties":false,"properties":{"id":{"type":"string"}},"required":["id"],"type":"object"}},"securitySchemes":{"apiKey":{"description":"Revise API key from the API console. Send Authorization: Bearer \u003ckey\u003e on account requests and artifact downloads.","scheme":"bearer","type":"http"}}},"info":{"description":"Asynchronous document prompts and format conversions. Submit a job, poll its receipt or receive a webhook, then download its artifacts. USD amounts are exact decimal strings. Job content expires 24 hours after terminal completion. All account endpoints require a bearer API key.","title":"Revise document API","version":"0.1.0"},"openapi":"3.1.0","paths":{"/api/v1/account":{"get":{"operationId":"getAccount","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}},"description":"The signed credit balance and funding capabilities."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"summary":"Read the account credit balance"}},"/api/v1/account/ledger":{"get":{"description":"Latest 50 entries with no pagination. available_delta_usd is the signed net change in account credit. Prompt and conversion entries expose the corresponding job ID; funding entries have neither. Use /v1/usage for historical charge aggregation.","operationId":"getLedger","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ledger"}}},"description":"Read the latest 50 credit entries"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"summary":"Read the latest 50 credit entries"}},"/api/v1/account/topups/{id}":{"get":{"description":"Read an existing funding order. Amounts are integer cents. Create top-ups and manage payment settings in the API console. Returns 503 funding_unavailable when funding is not enabled.","operationId":"getTopup","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundingOrder"}}},"description":"Read funding status without payment secrets"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"summary":"Read funding status without payment secrets"}},"/api/v1/artifacts/{id}":{"get":{"operationId":"getArtifact","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Artifact"}}},"description":"Read metadata for an immutable output variant"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"summary":"Read metadata for an immutable output variant"}},"/api/v1/artifacts/{id}/content":{"get":{"description":"Returns artifact bytes directly or a 302 redirect to a signed storage URL valid for five minutes. Follow the redirect without forwarding Authorization across origins; with curl use --location, never --location-trusted. Verify length and SHA-256 against artifact metadata. Deleted or expired content returns 410. Encrypted downloads use application/jose and a .jwe filename.","operationId":"downloadArtifact","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/jose":{"example":"protected.encrypted_key.iv.ciphertext.tag","schema":{"type":"string"}},"application/pdf":{"schema":{"format":"binary","type":"string"}},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"schema":{"format":"binary","type":"string"}},"text/html":{"schema":{"format":"binary","type":"string"}},"text/markdown":{"schema":{"format":"binary","type":"string"}},"text/plain":{"schema":{"format":"binary","type":"string"}}},"description":"The exact output bytes, or compact JWE ciphertext when output encryption was requested."},"302":{"description":"Redirect to a short-lived signed artifact download URL. Follow without forwarding bearer credentials.","headers":{"Location":{"schema":{"format":"uri","type":"string"}}}},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"summary":"Download artifact content"}},"/api/v1/convert":{"get":{"description":"Newest first, ordered by creation time then ID. Pass next_cursor with the same status filter for the next page; null means the end. Only status, limit, and cursor are supported. Cursors belong to the authenticated account.","operationId":"listConversions","parameters":[{"in":"query","name":"limit","schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"status","schema":{"enum":["queued","running","succeeded","failed","cancelled"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Conversion"},"type":"array"},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"type":"object"}}},"description":"Conversion page"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"summary":"List account conversions, newest first"},"post":{"description":"Convert one uploaded file to docx, pdf, md, html, or txt. Same-format conversion is rejected. DOCX, Markdown, HTML, text, RTF, and ODT use deterministic conversion at $0.005 each. PDF and image inputs use semantic scanning: $0.02 per page with managed inference on the default OpenAI model, or $0.005 per page plus provider inference when using your own OpenAI key. Only your own key permits another catalogued OpenAI model. Deterministic conversions reject nonempty inference settings.\n\nUploads are limited to 18 MiB, PDFs to 100 pages, and output to 50 MiB before encryption. There is no default spending cap; an explicitly set insufficient page budget fails with conversion_limit_exceeded before inference. PDF processing errors include pdf_page_limit_exceeded, pdf_password_protected, invalid_pdf, and empty_pdf. These validation failures are unbilled. Cancellation or customer limits can incur charges for work already performed; read settled usage. Conversions have no additional CPU or Revise inference fee and do not count toward prompt base-fee tiers.","operationId":"createConversion","parameters":[{"in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversionRequest"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conversion"}}},"description":"Queued conversion","headers":{"Idempotent-Replayed":{"description":"Present with value true on an idempotent replay.","schema":{"enum":["true"],"type":"string"}},"Location":{"description":"Account-authenticated path to retrieve this resource.","schema":{"type":"string"}},"Retry-After":{"description":"Suggested delay before polling, in seconds.","schema":{"example":"1","type":"string"}}}},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"summary":"Queue a file conversion"}},"/api/v1/convert/{id}":{"get":{"operationId":"getConversion","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conversion"}}},"description":"Conversion"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"summary":"Read conversion status, receipt, and output artifact"}},"/api/v1/convert/{id}/cancel":{"post":{"description":"Send no body. Queued work stops immediately; running work may still be stopping when the response returns. Poll until terminal. Completed jobs remain completed. Cancellation can incur charges for work already performed.","operationId":"cancelConversion","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Conversion"}}},"description":"Cancellation requested"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"summary":"Cancel a queued or running conversion; no body"}},"/api/v1/convert/{id}/content":{"delete":{"description":"Send no body. Delete retained conversion content, customer metadata, artifact bytes, and the claimed ephemeral upload. Persistent source templates are excluded. Status and accounting receipts remain. Repeated deletion succeeds; active or pinned content returns 409.","operationId":"deleteConversionContent","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted; status, receipt and idempotency tombstone remain"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"summary":"Delete conversion content"}},"/api/v1/files":{"post":{"description":"Upload one nonempty file with a supported extension: DOCX, MD/Markdown, HTML/HTM, TXT, RTF, ODT, PDF, JPEG/JPG, PNG, WebP, or GIF. Text, Markdown, and HTML must be UTF-8. Prompt targets accept only DOCX, Markdown, HTML, and text; other formats must be converted first. There is no public upload-list or original-file-download endpoint.","operationId":"uploadFile","parameters":[{"in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"minLength":1,"type":"string"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"additionalProperties":false,"properties":{"file":{"description":"One nonempty file, at most 18 MiB. Accounts may retain up to 100 undeleted uploads totaling 256 MiB. Filename: at most 255 bytes, with no path separators or control characters. DOCX/ODT expanded archives are limited to 128 MiB; DOCX archives may contain at most 10,000 entries.","format":"binary","type":"string"},"lifetime":{"default":"ephemeral","description":"Ephemeral files can be claimed by one request and are deleted immediately on success. Failed or cancelled requests retain their source for 24 hours; unused uploads expire 24 hours after upload. Persistent templates remain until explicit deletion.","enum":["ephemeral","persistent"],"type":"string"}},"required":["file"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/File"}}},"description":"Idempotent upload replay","headers":{"Idempotent-Replayed":{"description":"Present with value true on an idempotent replay.","schema":{"enum":["true"],"type":"string"}},"Location":{"description":"Account-authenticated path to retrieve this resource.","schema":{"type":"string"}}}},"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/File"}}},"description":"Uploaded file metadata. Store its ID for job creation or later deletion.","headers":{"Idempotent-Replayed":{"description":"Present with value true on an idempotent replay.","schema":{"enum":["true"],"type":"string"}},"Location":{"description":"Account-authenticated path to retrieve this resource.","schema":{"type":"string"}}}},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"summary":"Upload a file"}},"/api/v1/files/{id}":{"delete":{"operationId":"deleteFile","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted; tombstone retained for idempotency"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"summary":"Delete an uploaded file; rejects active use with 409"},"get":{"operationId":"getFile","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/File"}}},"description":"Read uploaded source metadata"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"summary":"Read uploaded source metadata"}},"/api/v1/models":{"get":{"description":"Return supported prompt model IDs and defaults without consuming inference or credit. Pass provider and id as inference.provider and inference.model. The complete list is sorted by provider then model ID. Optional provider filtering uses gemini for Google models. default is always the API-wide default; default_for_provider marks each provider default. This catalog does not report prices, live provider health, credentials, or capacity. Managed PDF/image scanning accepts only the default OpenAI model; other catalogued OpenAI scan models require your own key.","operationId":"listModels","parameters":[{"description":"Optional exact public provider.","in":"query","name":"provider","schema":{"enum":["openai","anthropic","xai","gemini"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"default_for_provider":true,"id":"gpt-6-luna","name":"GPT-6 Luna","provider":"openai"}],"default":{"model":"gpt-6-luna","provider":"openai"}},"schema":{"$ref":"#/components/schemas/ModelList"}}},"description":"Model catalog"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"summary":"List supported prompt models and defaults"}},"/api/v1/prompt":{"post":{"description":"Submit a text request or read, comment on, or edit one document. Prompt targets support DOCX, Markdown, HTML, and plain text. Convert other upload formats first. Edit access exports clean and tracked-changes DOCX artifacts; read/comment access requires export_document=true to export. A 202 response confirms admission; poll the receipt for completion and inspect incomplete and stop_reason even on success. Use /v1/models for supported providers and models.","operationId":"createPrompt","parameters":[{"in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":200,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptRequest"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Prompt"}}},"description":"Admission receipt, including on idempotent replay. May already be running or terminal. Save the ID and poll for the result.","headers":{"Idempotent-Replayed":{"description":"Present with value true on an idempotent replay.","schema":{"enum":["true"],"type":"string"}},"Location":{"description":"Account-authenticated path to retrieve this resource.","schema":{"type":"string"}},"Retry-After":{"description":"Suggested delay before polling, in seconds.","schema":{"example":"1","type":"string"}}}},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"summary":"Create a prompt"}},"/api/v1/prompt/{id}":{"get":{"operationId":"getPrompt","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Prompt"}}},"description":"Current status and receipt. Retained result content is omitted after expiry or deletion; settled usage remains."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"summary":"Read status, receipt, and unexpired result"}},"/api/v1/prompt/{id}/cancel":{"post":{"description":"Send no body. Queued work stops immediately; running work may still be stopping when the response returns. Poll until terminal. Completed jobs remain completed. Cancellation can incur charges for work already performed.","operationId":"cancelPrompt","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Prompt"}}},"description":"Cancel work; no request body"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"summary":"Cancel work; no request body"}},"/api/v1/prompt/{id}/content":{"delete":{"description":"Send no body. Delete retained prompt/result content, customer metadata, document state, artifacts, and the claimed ephemeral upload. Persistent source templates are excluded. Status and accounting receipts remain. Repeated deletion succeeds; active or pinned content returns 409.","operationId":"deletePromptContent","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted; status, receipt and idempotency tombstone remain"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"summary":"Delete all request content and ephemeral source"}},"/api/v1/prompt/{id}/resume":{"post":{"description":"Resume a paused prompt with new absolute cost limits. Omit a cost limit to remove that cap. Neither limit may decrease and at least one must increase or be removed; explicit limits must sum to at most $1,000,000. Pauses expire after 24 hours. Resumption keeps the job ID and does not incur another base fee. max_seconds is not accepted. An Idempotency-Key is not required; repeating previously applied limits replays that resume.","operationId":"resumePrompt","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"limits":{"additionalProperties":false,"properties":{"max_inference_cost_usd":{"description":" Must be greater than zero when supplied.","oneOf":[{"pattern":"^(?=[0-9.]*[1-9])[0-9]+(\\.[0-9]{1,9})?$","type":"string"},{"exclusiveMinimum":0,"maximum":1000000,"type":"number"}]},"max_platform_cost_usd":{"description":" Must be greater than zero when supplied.","oneOf":[{"pattern":"^(?=[0-9.]*[1-9])[0-9]+(\\.[0-9]{1,9})?$","type":"string"},{"exclusiveMinimum":0,"maximum":1000000,"type":"number"}]}},"required":[],"type":"object"}},"required":["limits"],"type":"object"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Prompt"}}},"description":"Raise absolute cost limits on a paused prompt"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"summary":"Raise absolute cost limits on a paused prompt"}},"/api/v1/prompts":{"get":{"description":"Returns Prompt receipts newest first, ordered by created_at then ID. Pass next_cursor with the same filters for the next page; null means the end. Cursors belong to the authenticated account. Filters combine with AND. Status is current, not a frozen snapshot. Metadata filters stop matching after content expiry or deletion. Unknown or repeated query parameters return 400.","operationId":"listPrompts","parameters":[{"in":"query","name":"limit","schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}},{"description":"The next_cursor returned by the previous page.","in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"status","schema":{"enum":["queued","running","paused","succeeded","failed","cancelled"],"type":"string"}},{"description":"Exact conv_ ID.","in":"query","name":"conversation_id","schema":{"type":"string"}},{"description":"Exact key_ ID of the submitting key. Older unattributed prompts do not match.","in":"query","name":"api_key_id","schema":{"type":"string"}},{"description":"Inclusive lower creation-time bound (RFC3339 with timezone).","in":"query","name":"created_after","schema":{"format":"date-time","type":"string"}},{"description":"Exclusive upper creation-time bound (RFC3339 with timezone).","in":"query","name":"created_before","schema":{"format":"date-time","type":"string"}},{"description":"Exact AND matches, e.g. metadata[customer]=Acme. Keys up to 64 bytes; values up to 512 bytes.","explode":true,"in":"query","name":"metadata","schema":{"additionalProperties":{"maxLength":512,"type":"string"},"maxProperties":16,"type":"object"},"style":"deepObject"}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"data":{"items":{"$ref":"#/components/schemas/Prompt"},"maxItems":100,"type":"array"},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"],"type":"object"}}},"description":"A page of prompts"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"summary":"List account prompts, newest first"}},"/api/v1/usage":{"get":{"description":"Aggregate settled prompts and conversions by completion time. Queued, running, and paused work is excluded. Totals reconcile to historical receipts, not current rates. Filters combine with AND; rows sort by UTC bucket and dimensions. The default window is the last 30 days.\n\nReports return at most 1,000 rows without pagination. Larger results return 422; narrow the range or use fewer groups/coarser buckets. Queries time out after five seconds with 503. Customer metadata expires with job content: metadata filters then stop matching and metadata dimensions become null, while account totals remain. Store job-to-customer mappings locally for long-term attribution. Model/provider dimensions describe admitted configuration, including deterministic conversions, rather than proving inference occurred. Unknown, empty, or repeated parameters return 400; empty metadata filter values are allowed.","operationId":"getUsage","parameters":[{"description":"Inclusive completion time. Defaults to 30 days before end. RFC3339 timezone required.","in":"query","name":"start","schema":{"format":"date-time","type":"string"}},{"description":"Exclusive completion time. Defaults to now. Range must be positive and at most 366 days; hourly ranges at most 31 days.","in":"query","name":"end","schema":{"format":"date-time","type":"string"}},{"description":"UTC calendar buckets, or no time bucketing. Empty time buckets are omitted.","in":"query","name":"bucket","schema":{"default":"day","enum":["hour","day","month","none"],"type":"string"}},{"description":"Comma-separated distinct dimensions, maximum three: api_key_id, provider, model, status, document_access, pricing_version, metadata.KEY (KEY 1–64 bytes). Missing values form null groups. Example: api_key_id,metadata.customer.","in":"query","name":"group_by","schema":{"type":"string"}},{"in":"query","name":"status","schema":{"enum":["succeeded","failed","cancelled"],"type":"string"}},{"description":"Exact conv_ ID.","in":"query","name":"conversation_id","schema":{"type":"string"}},{"description":"Exact key_ ID of the submitting key. Older unattributed prompts do not match.","in":"query","name":"api_key_id","schema":{"type":"string"}},{"description":"Exact AND matches, e.g. metadata[customer]=Acme. Keys up to 64 bytes; values up to 512 bytes.","explode":true,"in":"query","name":"metadata","schema":{"additionalProperties":{"maxLength":512,"type":"string"},"maxProperties":16,"type":"object"},"style":"deepObject"},{"description":"Exact requested provider. Gemini uses the public name gemini.","in":"query","name":"provider","schema":{"enum":["openai","anthropic","xai","gemini"],"type":"string"}},{"description":"Exact requested model ID; use with provider to disambiguate.","in":"query","name":"model","schema":{"maxLength":256,"type":"string"}},{"description":"Exact admitted document permission; not inferred from tool behavior.","in":"query","name":"document_access","schema":{"enum":["read","comment","edit"],"type":"string"}},{"description":"Exact pricing version pinned at admission.","in":"query","name":"pricing_version","schema":{"maxLength":256,"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"bucket":"day","data":[{"bucket_end":"2026-09-07T00:00:00Z","bucket_start":"2026-09-06T00:00:00Z","cost":{"itemized":{"base_fee_usd":"0.100000000","cpu_fee_usd":"0.100000000","inference_fee_usd":"0.020000000"},"total_usd":"0.220000000"},"dimensions":{"metadata.customer":"acme"},"inference_usage":{"cache_creation_input_tokens":0,"cached_input_tokens":800,"input_tokens":2400,"output_tokens":400,"web_search_requests_by_unit":{"calls":2,"grounded_prompts":0,"queries":0}},"request_count":2,"tool_cpu_seconds":"2.000000"},{"bucket_end":"2026-09-08T00:00:00Z","bucket_start":"2026-09-07T00:00:00Z","cost":{"itemized":{"base_fee_usd":"0.150000000","cpu_fee_usd":"0.150000000","inference_fee_usd":"0.030000000"},"total_usd":"0.330000000"},"dimensions":{"metadata.customer":"acme"},"inference_usage":{"cache_creation_input_tokens":0,"cached_input_tokens":1200,"input_tokens":3600,"output_tokens":600,"web_search_requests_by_unit":{"calls":3,"grounded_prompts":0,"queries":0}},"request_count":3,"tool_cpu_seconds":"3.000000"}],"end":"2026-09-08T00:00:00Z","group_by":["metadata.customer"],"start":"2026-09-06T00:00:00Z","time_basis":"completed_at","totals":{"cost":{"itemized":{"base_fee_usd":"0.250000000","cpu_fee_usd":"0.250000000","inference_fee_usd":"0.050000000"},"total_usd":"0.550000000"},"inference_usage":{"cache_creation_input_tokens":0,"cached_input_tokens":2000,"input_tokens":6000,"output_tokens":1000,"web_search_requests_by_unit":{"calls":5,"grounded_prompts":0,"queries":0}},"request_count":5,"tool_cpu_seconds":"5.000000"}},"schema":{"$ref":"#/components/schemas/UsageReport"}}},"description":"Complete filtered usage report"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"summary":"Aggregate settled account usage and customer charges"}},"/api/v1/webhooks":{"get":{"operationId":"listWebhooks","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookList"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"summary":"List active webhook endpoints (no signing secrets)"},"post":{"description":"Register up to 10 active account-wide endpoints. Use HTTPS port 443 and public addresses; redirects are not followed. Store signing_secret on creation: it is returned on idempotent replay but omitted from lists. Matching status transitions produce signed JSON notifications containing the job ID, not document content. Deliveries have a 30-second timeout and up to 11 attempts within 24 hours; duplicate or out-of-order delivery is possible. See the webhook guide for payloads, HMAC verification, and acknowledgement-based deletion.","operationId":"createWebhook","parameters":[{"in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":128,"minLength":1,"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"events":{"items":{"enum":["prompt.completed","prompt.failed","prompt.cancelled","prompt.paused","conversion.completed","conversion.failed","conversion.cancelled"],"type":"string"},"maxItems":7,"minItems":1,"type":"array","uniqueItems":true},"url":{"example":"https://app.example.com/hooks/revise","format":"uri","type":"string"}},"required":["url","events"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}},"description":"Webhook and signing secret, including on idempotent replay. No Idempotent-Replayed header is returned."},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"summary":"Register an HTTPS webhook endpoint"}},"/api/v1/webhooks/{id}":{"delete":{"operationId":"deleteWebhook","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted (idempotent); an in-flight request may already have reached the receiver"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"summary":"Disable endpoint and cancel pending deliveries"}},"/api/v1/webhooks/{id}/deliveries":{"get":{"description":"Newest first, scoped cursor. Retained for 30 days. Payloads, target response bodies, and secrets are not returned.","operationId":"listWebhookDeliveries","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"query","name":"limit","required":false,"schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}},{"in":"query","name":"cursor","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryList"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"summary":"List delivery history"}},"/api/v1/webhooks/{id}/deliveries/{delivery_id}/retry":{"post":{"description":"Send no body. Retry an exhausted delivery for an active endpoint: at most three manual cycles within seven days of creation. Each cycle has up to 11 attempts within 24 hours, bounded by the seven-day deadline. Reuse the same key to replay a retry. Notification ID and payload are preserved; deleted content is never restored. No Idempotent-Replayed header is returned.","operationId":"retryWebhookDelivery","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"path","name":"delivery_id","required":true,"schema":{"type":"string"}},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"maxLength":128,"minLength":1,"type":"string"}}],"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookRetry"}}},"description":"Success"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Error"}},"summary":"Retry an exhausted delivery"}}},"security":[{"apiKey":[]}],"servers":[{"url":"/"}]}
