Skip to main content
POST
/
prompt
Authorize a prompt
curl --request POST \
  --url https://api.interchange.lotiai.com/v1/prompt \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "prompt": {
    "contentType": "image",
    "licenseType": "personal",
    "promptText": "<string>",
    "promptMedia": [
      {
        "type": "video",
        "contentUrl": "<string>"
      }
    ],
    "identities": [
      "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    ],
    "pricingUnit": "word_count",
    "estimatedQuantity": 123
  }
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "promptText": "<string>",
  "enhancedPromptText": "<string>",
  "enhancedPromptStrictnessLevel": 3,
  "providerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "generatedContentType": "image",
  "licenseType": "personal",
  "pricingUnit": "word_count",
  "estimatedQuantity": 123,
  "estimatedTotalPriceMicros": 4503599627370495,
  "authorizationResult": "pending",
  "authorizationDeniedCode": "RULES_VIOLATION",
  "authorizationDeniedReason": "<string>",
  "identityAssets": {}
}

Authorizations

x-api-key
string
header
required

API key issued for Interchange; reach out to Loti to obtain an API key.

Body

application/json
prompt
object
required

Details about the prompt for which authorization is being requested.

Response

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

id
string<uuid>
required
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})$
createdAt
string<date-time>
required

ISO 8601 timestamp in UTC.

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))$
updatedAt
string<date-time>
required

ISO 8601 timestamp in UTC.

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))$
promptText
string
required

Original prompt text provided by the requester.

Minimum string length: 1
enhancedPromptText
string
required

Experimental: Prompt text after enhancement, if applied. This field may be removed in a future API version.

enhancedPromptStrictnessLevel
integer
required

Experimental: Strictness level applied by the enhancer. This field may be removed in a future API version.

Required range: 1 <= x <= 5
providerId
string<uuid>
required
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})$
generatedContentType
enum<string>
required

Type of content being generated.

Available options:
image,
video,
audio_voice
licenseType
enum<string>
required

Type of license for content usage: personal (non-commercial), limited_commercial (small business/limited reach), or major_commercial (large campaigns, requires approval).

Available options:
personal,
limited_commercial,
major_commercial
pricingUnit
enum<string>
required

Unit of generated content, for billing purposes.

Available options:
word_count,
asset_count,
length_seconds
estimatedQuantity
integer
required

Provider-supplied estimate of how many pricing units will be generated.

Required range: x <= 86400
estimatedTotalPriceMicros
integer
required

Estimated total price in micros (millionths of a USD); null when authorization is denied.

Required range: 0 <= x <= 9007199254740991
authorizationResult
enum<string>
required

Outcome of prompt authorization: 'authorized' (prompt approved, proceed to generate), 'not_authorized' (prompt denied, see authorizationDeniedCode and authorizationDeniedReason), or 'pending' (still processing).

Available options:
pending,
authorized,
not_authorized
authorizationDeniedCode
enum<string>
required

If prompt authorization was denied, contains a machine-readable code describing the denial reason.

Available options:
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
authorizationDeniedReason
string · null · null
required

If prompt authorization was denied, contains a human-readable explanation of the reason for denial.

identityAssets
object

If prompt was authorized, will contain a map from each Loti identity ID to their biometric asset URL for the requested content type.