Heista Adscript API
Generate direct-response ad scripts from a structural source + a PowerSource.
Generate direct-response ad scripts from a structural source + a PowerSource.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/heista-co:heista-co-adscript-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Heista Adscript API
version: 1.0.0
description: 'Creative intelligence as an API. Decode any video ad, extract brand intelligence from any URL or document, generate scripts in any brand''s voice, and browse the decoded corpus for free.
## Surfaces
- **Decode** — turn any video ad URL into a structural formula. Beats, hooks, psychology, visual playbook.
- **PowerSource** — 14-section brand intelligence from a URL, internal documents, or both.
- **Adscript** — generate 1–5 ad scripts from a proven structure + a PowerSource. Token-metered.
- **Files** — upload PDF/DOCX/TXT/MD for use in PowerSource docs mode.
- **Intelligence reads** — free corpus access (hook patterns, ad formulas, decoded ads).
- **Account** — credit balance, monthly usage, pricing.
## Pricing
- Decode: **$0.15** (≤60s) / **$0.20** (61–120s)
- PowerSource: **$1.00** (URL or docs only) / **$2.00** (URL + docs)
- Adscript: **token-metered**, typically **$0.02–$0.05** per script
- Intelligence reads, Files API: **free**
- Failed jobs auto-refund. Duplicate inputs (same org) return cached results at no charge.
## Authentication
Bearer header on every request:
```
Authorization: Bearer hst_live_your_key
```
Production keys are prefixed `hst_live_`; test keys are `hst_test_`. Get yours at heista.co/api-console.
## Errors
All errors follow RFC 9457 Problem Details. The same envelope shape across every endpoint; see the `ProblemDetails` schema.
Spending-cap and circuit-breaker errors include a `reason` field (`cap_hourly`, `cap_daily`, `cap_monthly`, `cap_key_daily`, `cap_key_monthly`, `circuit_open`). Insufficient-credits errors include `top_up_url`, `current_balance`, and `required` extensions.
## Rate limits
Per API key, per endpoint group. Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` (epoch ms). On 429 you also get `Retry-After` (seconds).'
contact:
name: Heista Support
email: support@heista.co
url: https://heista.co
termsOfService: https://heista.co/terms
license:
name: Proprietary
url: https://heista.co/terms
servers:
- url: https://www.heista.co/api/v1
description: Production
- url: http://localhost:3000/api/v1
description: Local development
security:
- bearerAuth: []
tags:
- name: Adscript
description: Generate direct-response ad scripts from a structural source + a PowerSource.
paths:
/adscript:
post:
tags:
- Adscript
summary: Generate 1–5 ad scripts
description: 'Synchronous, single API call. Combines a structural source (decoded ad or formula) with a PowerSource brand profile, then generates 1–5 finished scripts. Token-metered: typical 2–5 cents per script.
Pass `source_id` + `source_type` for the structure, `powersource_id` for the brand. Optional `count` (1–5), `script_mode` (`blueprint` or `remix`), `duration` (10–120s for remix), `audience`, `tension`, `selling_points`, `voice_mode` (`creator` or `brand`).'
operationId: generateAdscript
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AdscriptRequest'
responses:
'200':
description: Generation complete
content:
application/json:
schema:
$ref: '#/components/schemas/AdscriptResponse'
'400':
$ref: '#/components/responses/ValidationError'
'401':
$ref: '#/components/responses/Unauthorized'
'402':
$ref: '#/components/responses/InsufficientCredits'
'403':
$ref: '#/components/responses/CircuitBreaker'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/InternalError'
components:
responses:
ValidationError:
description: Request validation failed
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
InsufficientCredits:
description: Balance too low. Includes `current_balance`, `required`, and `top_up_url`.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/InsufficientCreditsProblem'
Unauthorized:
description: Missing or invalid API key
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
InternalError:
description: Internal error
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
NotFound:
description: Resource not found or not owned by this org
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
CircuitBreaker:
description: 'Account paused (anomaly detection) — `reason: circuit_open`. Review at the API console.'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/SpendingCapProblem'
RateLimited:
description: Rate limit exceeded. Includes `Retry-After` (seconds).
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
schemas:
InsufficientCreditsProblem:
allOf:
- $ref: '#/components/schemas/ProblemDetails'
- type: object
properties:
current_balance:
type: integer
description: Current balance in cents
required:
type: integer
description: Cents required for this operation
top_up_url:
type: string
format: uri
example: https://heista.co/api-console/billing
resource:
type: string
example: decode
AdscriptOutput:
type: object
properties:
index:
type: integer
script:
type: string
formula_name:
type: string
identity:
type: object
properties:
creative_format:
type: string
algo_intent:
type: string
marketing_angle:
type: string
psychological_mission:
type: string
behavioural_role:
type: string
beat_count:
type: integer
duration_seconds:
type: number
credits_cost:
type: number
nullable: true
description: Credits charged for this script ($1 = 1 credit); null while settling.
AdscriptResponse:
type: object
properties:
status:
type: string
enum:
- completed
source_id:
type: string
source_type:
type: string
powersource_id:
type: string
scripts:
type: array
items:
$ref: '#/components/schemas/AdscriptOutput'
credits_charged:
type: number
nullable: true
description: Credits charged across all scripts ($1 = 1 credit), read back from the ledger at the real model cost. null while the charge is still settling — never 0 for unknown.
price:
type: number
nullable: true
description: Same amount in USD.
created_at:
type: string
format: date-time
ProblemDetails:
type: object
description: RFC 9457 Problem Details envelope used for every error.
required:
- type
- title
- status
properties:
type:
type: string
format: uri
example: https://api.heista.co/errors/validation-error
title:
type: string
example: Validation error
status:
type: integer
example: 400
detail:
type: string
instance:
type: string
format: uri
request_id:
type: string
example: req_a1b2c3d4
SpendingCapProblem:
allOf:
- $ref: '#/components/schemas/ProblemDetails'
- type: object
properties:
reason:
type: string
enum:
- cap_hourly
- cap_daily
- cap_monthly
- cap_key_daily
- cap_key_monthly
- circuit_open
top_up_url:
type: string
format: uri
AdscriptRequest:
type: object
required:
- source_id
- source_type
- powersource_id
properties:
source_id:
type: string
maxLength: 128
source_type:
type: string
enum:
- decode
- formula
powersource_id:
type: string
maxLength: 128
count:
type: integer
minimum: 1
maximum: 5
script_mode:
type: string
enum:
- blueprint
- remix
duration:
type: integer
minimum: 10
maximum: 120
description: Remix mode only.
audience:
type: string
maxLength: 128
tension:
type: string
maxLength: 256
selling_points:
type: array
items:
type: string
maxLength: 512
maxItems: 5
voice_mode:
type: string
enum:
- creator
- brand
idempotency_key:
type: string
maxLength: 128
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: hst_live_xxx (production) or hst_test_xxx (test)
description: API key issued at heista.co/api-console.