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

# Estimate submission price

> Preview how many credits a submission will cost, before you create it.

Call this **after uploading your assets** (via `POST /uploads/url`) and
**before** `POST /submissions`. Pass the same
`blobPath`s you intend to submit; the response returns the credit cost per
asset plus a `totalCredits` for the whole batch.

The asset type and MIME type are derived from the blobPath server-side — the
same way the create endpoint does — and the cost is computed from a metric
measured on the uploaded bytes themselves (video duration, document page
count), never declared by the client. So the estimate matches the amount
actually charged when you create the submission. The measurement is cached, so
the subsequent submission does not re-read the file.

This endpoint is read-only: it does not create a submission, move any blob, or
consume credits. An asset whose metric can't be measured (e.g. an unreadable
PDF) comes back with `priceable: false` and `credits: 0`, and is excluded from
`totalCredits`; re-upload it as a readable file before submitting.



## OpenAPI

````yaml post /api/integrations/pricing/estimate
openapi: 3.1.0
info:
  title: Midmarket Integrations API
  description: An API for Midmarket integrations.
  version: 0.1.0
servers:
  - url: https://mm-midmarket-integrations-api-preview.azurewebsites.net
    description: preview
security: []
paths:
  /api/integrations/pricing/estimate:
    post:
      tags:
        - pricing
      summary: Estimate submission price
      description: >-
        Preview how many credits a submission will cost, before you create it.


        Call this **after uploading your assets** (via `POST /uploads/url`) and

        **before** `POST /submissions`. Pass the same

        `blobPath`s you intend to submit; the response returns the credit cost
        per

        asset plus a `totalCredits` for the whole batch.


        The asset type and MIME type are derived from the blobPath server-side —
        the

        same way the create endpoint does — and the cost is computed from a
        metric

        measured on the uploaded bytes themselves (video duration, document page

        count), never declared by the client. So the estimate matches the amount

        actually charged when you create the submission. The measurement is
        cached, so

        the subsequent submission does not re-read the file.


        This endpoint is read-only: it does not create a submission, move any
        blob, or

        consume credits. An asset whose metric can't be measured (e.g. an
        unreadable

        PDF) comes back with `priceable: false` and `credits: 0`, and is
        excluded from

        `totalCredits`; re-upload it as a readable file before submitting.
      operationId: estimate_pricing_api_integrations_pricing_estimate_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PricingEstimateRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PricingEstimateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - apiKey: []
components:
  schemas:
    PricingEstimateRequest:
      properties:
        files:
          items:
            $ref: '#/components/schemas/PricingEstimateFileInput'
          type: array
          title: Files
          description: >-
            The uploaded assets you intend to submit. The same blobPaths you
            would pass to POST /submissions.
          default: []
      type: object
      title: PricingEstimateRequest
      example:
        files:
          - blobPath: 550e8400-e29b-41d4-a716-446655440000/campaign-video.mp4
          - blobPath: 660e8400-e29b-41d4-a716-446655440111/brief.pdf
    PricingEstimateResponse:
      properties:
        files:
          items:
            $ref: '#/components/schemas/PricedFileSchema'
          type: array
          title: Files
          description: Per-file pricing, in the order supplied.
          default: []
        totalCredits:
          type: integer
          title: Totalcredits
          description: >-
            Sum of credits across all priceable files — what creating the
            submission will cost.
          default: 0
      type: object
      title: PricingEstimateResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PricingEstimateFileInput:
      properties:
        blobPath:
          type: string
          minLength: 1
          title: Blobpath
          description: >-
            Pending-container blobPath returned by POST /uploads/url, e.g.
            '{assetId}/{filename}'. The same value you pass to POST
            /submissions.
      type: object
      required:
        - blobPath
      title: PricingEstimateFileInput
      description: >-
        One uploaded asset to price, referenced only by its pending blobPath.


        The asset type and MIME type are derived server-side from the blobPath
        (the

        same way the create endpoint does), so the previewed price uses the
        identical

        classification as the eventual charge — nothing else need be supplied.
    PricedFileSchema:
      properties:
        blobPath:
          type: string
          title: Blobpath
          description: The blobPath you supplied for this file.
        assetType:
          anyOf:
            - type: string
            - type: 'null'
          title: Assettype
          description: >-
            The asset type derived from the blobPath ('video', 'document',
            'image', ...), or null if it could not be classified (priced at the
            flat rate).
        metric:
          anyOf:
            - type: string
            - type: 'null'
          title: Metric
          description: >-
            The metric the price is based on: 'durationSeconds' for video,
            'pages' for documents, or null for flat-priced types.
        metricValue:
          anyOf:
            - type: integer
            - type: 'null'
          title: Metricvalue
          description: >-
            The measured value of that metric (e.g. 42 seconds, 8 pages), or
            null when not measured.
        credits:
          type: integer
          title: Credits
          description: >-
            Credits this asset will cost at submit. 0 when priceable is false
            (the asset is excluded from the total).
        priceable:
          type: boolean
          title: Priceable
          description: >-
            False when the billable metric could not be measured (e.g. an
            unreadable PDF). Such an asset is rejected when you create the
            submission, so re-upload it as a readable file before submitting.
      type: object
      required:
        - blobPath
        - credits
        - priceable
      title: PricedFileSchema
      description: The credit cost of one asset and the metric that drove it.
    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
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'Workspace-scoped API key. Format: sk_live_{64 hex chars}'
      x-default: sk_live_your_api_key_here

````