> ## Documentation Index
> Fetch the complete documentation index at: https://revise.io/developer/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel a prompt

> 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.

See [prompt workflows](/developer/docs/developer/docs/revise-api/prompts) for integration guidance.

## TypeScript

```ts theme={null}
import { ReviseClient } from "@reviseio/api";

const revise = new ReviseClient({ apiKey: process.env.REVISE_API_KEY! });
const result = await revise.prompts.cancel("prompt_id");
```


## OpenAPI

````yaml developer/docs/openapi/revise-api.json POST /v1/prompt/{id}/cancel
openapi: 3.1.0
info:
  title: Revise API
  version: 0.1.0
  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.
servers:
  - url: https://revise.io/api
security:
  - apiKey: []
paths:
  /v1/prompt/{id}/cancel:
    post:
      summary: Cancel work; no request body
      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:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '202':
          description: Cancel work; no request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Prompt'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Prompt:
      type: object
      properties:
        id:
          type: string
        conversation_id:
          type: string
        previous_prompt_id:
          anyOf:
            - type: string
            - type: 'null'
        status:
          enum:
            - queued
            - running
            - paused
            - succeeded
            - failed
            - cancelled
        created_at:
          type: string
          format: date-time
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        conversation_expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        message:
          anyOf:
            - $ref: '#/components/schemas/Message'
            - type: 'null'
        continuation:
          $ref: '#/components/schemas/Continuation'
        comments:
          type: array
          items:
            $ref: '#/components/schemas/NativeComment'
          description: >-
            Flat native comment records; replies use parentId. Omitted when
            disabled by response_options or when content is unavailable.
        changes:
          type: array
          items:
            $ref: '#/components/schemas/NativeTrackedChange'
          description: >-
            Pending native tracked changes. Replacements can appear as linked
            insertion/deletion entries. Omitted when disabled by
            response_options or when content is unavailable.
        artifacts:
          type: array
          items:
            $ref: '#/components/schemas/Artifact'
        usage:
          anyOf:
            - $ref: '#/components/schemas/Usage'
            - type: 'null'
        metadata:
          $ref: '#/components/schemas/Metadata'
        inference:
          type: object
          properties:
            provider:
              enum:
                - openai
                - anthropic
                - xai
                - gemini
            model:
              type: string
            billing:
              enum:
                - revise
                - provider
              description: >-
                The billing that applied at admission; fixed for the life of the
                request even if account keys change later.
          required:
            - provider
            - model
            - billing
          additionalProperties: false
        limits:
          type: object
          properties:
            max_platform_cost_usd:
              type: string
              pattern: ^-?[0-9]+\.[0-9]{9}$
              example: '0.050000000'
            max_inference_cost_usd:
              type: string
              pattern: ^-?[0-9]+\.[0-9]{9}$
              example: '0.050000000'
            max_seconds:
              type: integer
          required:
            - max_seconds
          additionalProperties: false
        error:
          anyOf:
            - type: object
              properties:
                code:
                  type: string
                message:
                  type: string
                details:
                  type: object
                  additionalProperties: true
              required:
                - code
                - message
              additionalProperties: false
            - type: 'null'
        api_key_id:
          type:
            - string
            - 'null'
          description: >-
            Non-secret ID of the key that originally submitted this prompt; null
            when not recorded. Idempotent retries preserve the original key.
        output_encrypted:
          type: boolean
          description: >-
            True disables continuation and reuse. Artifacts are encrypted for
            the supplied public key.
        content_expires_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            24 hours after terminal completion. Result content and new
            continuation become unavailable at this deadline.
        content_deleted_at:
          type:
            - string
            - 'null'
          format: date-time
        retention:
          $ref: '#/components/schemas/RetentionOptions'
        incomplete:
          type: boolean
          description: True when the request returned a partial result.
        stop_reason:
          type: string
          enum:
            - spending_limit
            - time_limit
          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.
      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
      additionalProperties: false
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: object
              additionalProperties: true
          required:
            - code
            - message
          additionalProperties: false
      required:
        - error
      additionalProperties: false
    Message:
      type: object
      properties:
        role:
          const: assistant
        content:
          type: string
        incomplete:
          type: boolean
        citations:
          type: array
          items:
            $ref: '#/components/schemas/Citation'
      required:
        - role
        - content
        - incomplete
      additionalProperties: false
    Continuation:
      type: object
      properties:
        reasoning_state:
          enum:
            - new
            - reused
            - reset
            - compacted
            - unavailable
        history_compacted:
          anyOf:
            - type: boolean
            - type: 'null'
        reason:
          type: string
      required:
        - reasoning_state
        - history_compacted
      additionalProperties: false
    NativeComment:
      type: object
      description: >-
        Flat native comment record. Replies use parentId. Anchors are carried in
        the document, with anchorBlockId available for structural anchors.
        Native fields retain camelCase.
      required:
        - id
        - author
        - createdAt
        - bodyMd
      additionalProperties: true
      properties:
        id:
          type: string
        author:
          type: string
        initials:
          type: string
        authorId:
          type: string
        authorImageUrl:
          type: string
        createdAt:
          type: string
          format: date-time
        bodyMd:
          type: string
          description: Comment text in Markdown.
        parentId:
          type: string
          description: Parent comment ID for a reply; absent for a root comment.
        agentRequestId:
          type: string
        agentConversationId:
          type: string
        agentName:
          type: string
        agentModel:
          type: string
        suggestionId:
          type: string
        anchorBlockId:
          type: string
        agentTriggerIds:
          type: array
          items:
            type: string
        relatedSuggestionIds:
          type: array
          items:
            type: string
        resolved:
          type: boolean
        authorType:
          enum:
            - human
            - ai
        importedId:
          type: integer
        citations:
          type: array
          items:
            $ref: '#/components/schemas/Citation'
        mentions:
          type: array
          items:
            type: object
            required:
              - id
              - type
              - label
              - start
              - end
            properties:
              id:
                type: string
              type:
                enum:
                  - user
                  - agent
              label:
                type: string
              start:
                type: integer
              end:
                type: integer
              email:
                type: string
            additionalProperties: true
    NativeTrackedChange:
      type: object
      description: >-
        Pending tracked change with native camelCase fields. May include
        revisions already present in the input.
      required:
        - id
        - kind
        - author
        - authorType
        - blockIds
      properties:
        id:
          type: string
        kind:
          enum:
            - insert
            - delete
            - format
            - move
        blockIds:
          type: array
          items:
            type: string
        commentThreadId:
          type: string
        author:
          type: string
        agentModel:
          type: string
        description:
          type: string
        insertedText:
          type: string
        deletedText:
          type: string
        authorType:
          enum:
            - human
            - ai
        createdAt:
          type: number
          description: Unix time in milliseconds, when recorded.
        moveSourceBlockIds:
          type: array
          items:
            type: string
        moveDestinationBlockIds:
          type: array
          items:
            type: string
      additionalProperties: true
    Artifact:
      type: object
      properties:
        id:
          type: string
        prompt_id:
          type: string
        conversion_id:
          type: string
        format:
          enum:
            - docx
            - pdf
            - md
            - html
            - txt
        filename:
          type: string
          description: >-
            Original plaintext filename, even when encrypted. Encrypted
            downloads append .jwe.
        content_type:
          type: string
          description: >-
            Original plaintext MIME type. Encrypted downloads use
            application/jose.
        variant:
          enum:
            - tracked_changes
            - clean
            - converted
        sha256:
          type: string
          description: >-
            SHA-256 of the exact downloadable bytes (ciphertext for encrypted
            artifacts).
        bytes:
          type: integer
          description: >-
            Size of the downloadable bytes, including JWE encoding overhead when
            encrypted.
        download_url:
          type: string
          description: >-
            Account-authenticated API path. The endpoint may redirect to signed
            storage; never forward bearer credentials to storage.
        input_eligible:
          type: boolean
          description: >-
            True only for an unexpired, undeleted, unencrypted prompt artifact.
            Conversion artifacts are not directly reusable; download and upload
            them first.
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
        encryption:
          $ref: '#/components/schemas/ArtifactEncryption'
        deleted_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - id
        - format
        - filename
        - content_type
        - variant
        - sha256
        - bytes
        - download_url
        - input_eligible
        - expires_at
        - deleted_at
      additionalProperties: false
    Usage:
      type: object
      properties:
        pricing_version:
          type: string
        platform:
          type: object
          properties:
            tool_cpu_seconds:
              type: string
              pattern: ^[0-9]+\.[0-9]{6}$
              example: '1.250000'
            tool_cpu_rate_usd_per_second:
              type: string
              pattern: ^-?[0-9]+\.[0-9]{9}$
              example: '0.050000000'
          required:
            - tool_cpu_seconds
            - tool_cpu_rate_usd_per_second
          additionalProperties: false
        inference:
          type: object
          properties:
            billed_by:
              enum:
                - revise
                - provider
              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.
            input_tokens:
              type: integer
              minimum: 0
            cached_input_tokens:
              type: integer
              minimum: 0
            cache_creation_input_tokens:
              type: integer
              minimum: 0
            output_tokens:
              type: integer
              minimum: 0
            web_search_requests:
              type: integer
              minimum: 0
            web_search_unit:
              type: string
              enum:
                - calls
                - queries
                - grounded_prompts
          required:
            - billed_by
          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.
        conversion:
          type: object
          properties:
            unit:
              enum:
                - conversion
                - page
                - word
              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.
            quantity:
              type: integer
              minimum: 0
              description: >-
                Units billed: 1 (or 0 if unbilled) for conversion, scanned pages
                for page, output words for word.
            unit_price_usd:
              type: string
              pattern: ^-?[0-9]+\.[0-9]{9}$
              example: '0.020000000'
            minimum_fee_usd:
              type: string
              pattern: ^-?[0-9]+\.[0-9]{9}$
              description: Only present for unit word.
          required:
            - unit
            - quantity
            - unit_price_usd
          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.
        cost:
          $ref: '#/components/schemas/Cost'
      required:
        - pricing_version
        - platform
        - inference
        - cost
      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:
        pricing_version: local-v8-conversion-pages
        platform:
          tool_cpu_seconds: '1.000000'
          tool_cpu_rate_usd_per_second: '0.050000000'
        inference:
          billed_by: revise
          input_tokens: 1200
          cached_input_tokens: 400
          cache_creation_input_tokens: 0
          output_tokens: 200
          web_search_requests: 1
          web_search_unit: calls
        cost:
          total_usd: '0.110000000'
          itemized:
            base_fee_usd: '0.050000000'
            cpu_fee_usd: '0.050000000'
            inference_fee_usd: '0.010000000'
    Metadata:
      type: object
      maxProperties: 16
      additionalProperties:
        type: string
        maxLength: 512
      propertyNames:
        minLength: 1
        maxLength: 64
      example:
        customer: acme
        environment: production
      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.
    RetentionOptions:
      type: object
      additionalProperties: false
      properties:
        delete_after_webhook_id:
          type: string
          pattern: ^wh_[0-9a-f-]{36}$
          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.
      required:
        - delete_after_webhook_id
    Citation:
      type: object
      properties:
        id:
          type: string
        url:
          type: string
        title:
          type: string
        startIndex:
          type: integer
        endIndex:
          type: integer
      required:
        - id
        - url
        - title
      additionalProperties: false
    ArtifactEncryption:
      type: object
      additionalProperties: false
      required:
        - format
        - alg
        - enc
        - key_id
      properties:
        format:
          type: string
          enum:
            - jwe
        alg:
          type: string
          enum:
            - RSA-OAEP-256
        enc:
          type: string
          enum:
            - A256GCM
        key_id:
          type: string
          description: >-
            Base64url SHA-256 JWK thumbprint of the recipient public key
            (RFC7638).
    Cost:
      type: object
      additionalProperties: false
      required:
        - total_usd
        - itemized
      properties:
        total_usd:
          type: string
          pattern: ^[0-9]+\.[0-9]{9}$
          example: '0.305000000'
        itemized:
          type: object
          additionalProperties: false
          required:
            - base_fee_usd
            - cpu_fee_usd
            - inference_fee_usd
          properties:
            base_fee_usd:
              type: string
              pattern: ^[0-9]+\.[0-9]{9}$
              example: '0.250000000'
            cpu_fee_usd:
              type: string
              pattern: ^[0-9]+\.[0-9]{9}$
              example: '0.005000000'
            inference_fee_usd:
              type: string
              pattern: ^[0-9]+\.[0-9]{9}$
              example: '0.050000000'
      example:
        total_usd: '0.305000000'
        itemized:
          base_fee_usd: '0.250000000'
          cpu_fee_usd: '0.005000000'
          inference_fee_usd: '0.050000000'
      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.
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        Revise API key from https://revise.io/console/api-keys. Send
        Authorization: Bearer <key>.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.