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

# Authorize a prompt

> Submit a prompt for authorization, and get a price estimate if approved.



## OpenAPI

````yaml /openapi.yaml post /prompt
openapi: 3.0.1
info:
  title: Interchange Public API
  version: 0.4.0
servers:
  - url: https://api.interchange.lotiai.com/v1
    description: Production
  - url: https://preview.api.interchange.lotiai.com/v1
    description: Preview
security:
  - ApiKeyAuth: []
paths:
  /prompt:
    post:
      tags:
        - Interchange
      summary: Authorize a prompt
      description: Submit a prompt for authorization, and get a price estimate if approved.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostPromptRequest'
      responses:
        '200':
          description: >-
            Prompt was successfully evaluated. Check authorizationResult field:
            'authorized' means the prompt can proceed; 'not_authorized' means it
            was denied (see authorizationDeniedCode and
            authorizationDeniedReason for details).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostPromptResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    PostPromptRequest:
      type: object
      properties:
        prompt:
          $ref: '#/components/schemas/PostPromptBody'
      required:
        - prompt
      additionalProperties: false
    PostPromptResponse:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/UUIDv7'
        createdAt:
          $ref: '#/components/schemas/Timestamp'
        updatedAt:
          $ref: '#/components/schemas/Timestamp'
        promptText:
          $ref: '#/components/schemas/__schema9'
        enhancedPromptText:
          $ref: '#/components/schemas/__schema10'
        enhancedPromptStrictnessLevel:
          $ref: '#/components/schemas/__schema11'
        providerId:
          $ref: '#/components/schemas/UUIDv7'
        generatedContentType:
          $ref: '#/components/schemas/GeneratedContentType'
        licenseType:
          $ref: '#/components/schemas/LicenseType'
        pricingUnit:
          $ref: '#/components/schemas/PricingUnit'
        estimatedQuantity:
          $ref: '#/components/schemas/EstimatedQuantity'
        estimatedTotalPriceMicros:
          $ref: '#/components/schemas/__schema12'
        authorizationResult:
          $ref: '#/components/schemas/AuthorizationResult'
        authorizationDeniedCode:
          $ref: '#/components/schemas/AuthorizationDeniedCodeResponse'
        authorizationDeniedReason:
          $ref: '#/components/schemas/__schema13'
        identityAssets:
          $ref: '#/components/schemas/__schema15'
        identityReferenceAssets:
          $ref: '#/components/schemas/__schema17'
      required:
        - id
        - createdAt
        - updatedAt
        - promptText
        - enhancedPromptText
        - enhancedPromptStrictnessLevel
        - providerId
        - generatedContentType
        - licenseType
        - pricingUnit
        - estimatedQuantity
        - estimatedTotalPriceMicros
        - authorizationResult
        - authorizationDeniedCode
        - authorizationDeniedReason
      additionalProperties: false
    Error:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/__schema19'
      required:
        - error
      additionalProperties: false
      description: Error payload with error message string.
    PostPromptBody:
      type: object
      properties:
        contentType:
          $ref: '#/components/schemas/GeneratedContentType'
        licenseType:
          $ref: '#/components/schemas/__schema1'
        promptText:
          $ref: '#/components/schemas/PromptText'
        promptMedia:
          $ref: '#/components/schemas/PromptMediaContent'
        identities:
          $ref: '#/components/schemas/PromptIdentities'
        pricingUnit:
          $ref: '#/components/schemas/PricingUnit'
        estimatedQuantity:
          $ref: '#/components/schemas/EstimatedQuantity'
      required:
        - contentType
        - licenseType
        - promptText
        - promptMedia
        - identities
        - pricingUnit
        - estimatedQuantity
      additionalProperties: false
      description: Details about the prompt for which authorization is being requested.
    UUIDv7:
      type: string
      format: uuid
      pattern: >-
        ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-7[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$
    Timestamp:
      type: string
      format: date-time
      pattern: >-
        ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
      description: ISO 8601 timestamp in UTC.
    __schema9:
      nullable: true
      allOf:
        - $ref: '#/components/schemas/PromptText'
    __schema10:
      nullable: true
      allOf:
        - $ref: '#/components/schemas/EnhancedPromptText'
    __schema11:
      nullable: true
      allOf:
        - $ref: '#/components/schemas/EnhancedPromptStrictnessLevel'
    GeneratedContentType:
      type: string
      enum:
        - image
        - video
        - audio_voice
      description: Type of content being generated.
    LicenseType:
      type: string
      enum:
        - personal
        - limited_commercial
        - major_commercial
      description: >-
        Type of license for content usage: personal (non-commercial),
        limited_commercial (small business/limited reach), or major_commercial
        (large campaigns, requires approval).
    PricingUnit:
      type: string
      enum:
        - word_count
        - asset_count
        - length_seconds
      description: Unit of generated content, for billing purposes.
    EstimatedQuantity:
      type: integer
      exclusiveMinimum: true
      maximum: 86400
      description: Provider-supplied estimate of how many pricing units will be generated.
    __schema12:
      nullable: true
      allOf:
        - $ref: '#/components/schemas/EstimatedTotalPriceMicros'
    AuthorizationResult:
      type: string
      enum:
        - pending
        - authorized
        - not_authorized
      description: >-
        Outcome of prompt authorization: 'authorized' (prompt approved, proceed
        to generate), 'not_authorized' (prompt denied, see
        authorizationDeniedCode and authorizationDeniedReason), or 'pending'
        (still processing).
    AuthorizationDeniedCodeResponse:
      nullable: true
      description: >-
        If prompt authorization was denied, contains a machine-readable code
        describing the denial reason.
      allOf:
        - $ref: '#/components/schemas/AuthorizationDeniedCode'
    __schema13:
      allOf:
        - $ref: '#/components/schemas/AuthorizationDeniedReason'
    __schema15:
      allOf:
        - $ref: '#/components/schemas/IdentityAssets'
    __schema17:
      allOf:
        - $ref: '#/components/schemas/IdentityReferenceAssets'
    __schema19:
      type: string
    __schema1:
      description: >-
        Usage context for the generated content. Provider must determine this
        from end-user.
      allOf:
        - $ref: '#/components/schemas/LicenseType'
    PromptText:
      type: string
      minLength: 1
      description: Original prompt text provided by the requester.
    PromptMediaContent:
      type: array
      items:
        $ref: '#/components/schemas/MediaContent'
      description: Media attachments provided by the requester.
    PromptIdentities:
      type: array
      items:
        $ref: '#/components/schemas/UUIDv7'
      description: >-
        Optional list of Loti identity IDs that are known to be present in the
        prompt text or media. This will typically be empty. Even if present, the
        system will still attempt to automatically detect identities in the
        prompt text and media.
    EnhancedPromptText:
      type: string
      description: >-
        Experimental: Prompt text after enhancement, if applied. This field may
        be removed in a future API version.
    EnhancedPromptStrictnessLevel:
      type: integer
      minimum: 1
      maximum: 5
      description: >-
        Experimental: Strictness level applied by the enhancer. This field may
        be removed in a future API version.
    EstimatedTotalPriceMicros:
      type: integer
      minimum: 0
      maximum: 9007199254740991
      description: >-
        Estimated total price in micros (millionths of a USD); null when
        authorization is denied.
    AuthorizationDeniedCode:
      type: string
      enum:
        - RULES_VIOLATION
        - RULES_NOT_CONFIGURED
        - RATE_CARD_NOT_CONFIGURED
        - INCOMPLETE_PRICING
        - NO_IDENTITIES
        - NO_TEXT
        - IDENTITIES_NOT_FOUND
        - MAJOR_COMMERCIAL_NOT_SUPPORTED
        - NO_AGREEMENT_FOR_LICENSE_TYPE
      description: >-
        Machine-readable code describing why prompt authorization was denied,
        when applicable.
    AuthorizationDeniedReason:
      nullable: true
      description: >-
        If prompt authorization was denied, contains a human-readable
        explanation of the reason for denial.
      allOf:
        - $ref: '#/components/schemas/__schema14'
    IdentityAssets:
      type: object
      additionalProperties:
        $ref: '#/components/schemas/__schema16'
      deprecated: true
      description: >-
        DEPRECATED - use identityReferenceAssets. If prompt was authorized, maps
        each Loti identity ID to a single biometric asset URL for the requested
        content type (legacy identity_asset source).
    IdentityReferenceAssets:
      type: object
      additionalProperties:
        $ref: '#/components/schemas/__schema18'
      description: >-
        If prompt was authorized, maps each Loti identity ID to its active
        generation-ready reference assets, grouped by asset type (image,
        audio_voice) and ordered oldest-first (the first image is the
        canonical/frontal reference).
    MediaContent:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/MediaType'
        contentUrl:
          $ref: '#/components/schemas/MediaContentUrl'
      required:
        - type
        - contentUrl
      additionalProperties: false
      description: Media attachment with type and URL.
    __schema14:
      type: string
    __schema16:
      nullable: true
      allOf:
        - $ref: '#/components/schemas/IdentityAssetUrl'
    __schema18:
      type: object
      additionalProperties:
        type: array
        items:
          $ref: '#/components/schemas/IdentityAssetUrl'
    MediaType:
      type: string
      enum:
        - video
        - audio
        - image
        - archive
      description: Type of media asset.
    MediaContentUrl:
      type: string
      description: Publicly accessible URL to the media content.
    IdentityAssetUrl:
      type: string
      description: URL to the identity's biometric asset (face or voice).
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key issued for Interchange; reach out to Loti to obtain an API key.

````