Aveiro API
Embed
Embed usage API
Sites
List Sites
List Templates
Create Site
Pages
Create a Page
Delete a Page
List Pages
Reorder Pages
Update a Page
Site Media
Publish Site
Audience
Newsletter API Overview
Newsletter Campaigns
Social
Social API Overview
Social Accounts
Social Media
Social Posts
Social Performance
Website Mockup Video
Authentication
TrademarkTrademark
Ctrl k
Search…
Sign up
Aveiro API
Embed
Embed usage API
Sites
List Sites
List Templates
Create Site
Pages
Create a Page
Delete a Page
List Pages
Reorder Pages
Update a Page
Site Media
Publish Site
Audience
Newsletter API Overview
Newsletter Campaigns
Social
Social API Overview
Social Accounts
Social Media
Social Posts
Social Performance
Website Mockup Video
Authentication
Sponsored
Aveiro
aveiro.app
Sponsored
Aveiro
aveiro.app
TrademarkTrademark
AveiroBlogContact
© Aveiro. All rights reserved.
Built with Aveiro

Embed usage API

Reserve and settle AI credits when a satellite product (for example Frametic) starts renders on behalf of an organization.
Updated 1h ago
In short
Satellite products embedded in Aveiro (for example Frametic Studio) call these routes to reserve and settle AI credits for renders they start. Authentication is a deployment-scoped bearer key (FRAMETIC_EMBED_USAGE_KEY), not an org API token. Reserve debits at enqueue; settle refunds unused credits or the full amount on failure.

Who this is for

These routes are for satellite operators whose product is embedded in Aveiro via SatelliteEmbed. When the satellite starts a render on its own infrastructure, it must spend the host organization's credits through Aveiro — not quote prices itself. End-user automations and agents should continue using org API tokens and the Website mockup video API (social:write). Dashboard-initiated renders from Frametic Studio still go through the org's internal render endpoint; these embed routes are the billing path when the satellite calls Aveiro directly. Platform guide: Frametic Studio.

Authentication

Authorization: Bearer <FRAMETIC_EMBED_USAGE_KEY> Content-Type: application/json
The key is configured on the Aveiro host (FRAMETIC_EMBED_USAGE_KEY). When unset, both endpoints return 401 Unauthorized. This credential is scoped to embed usage only — it cannot read pages, draft social posts, or publish sites.

Base URL

https://www.aveiro.app/api/v1/embed/usage
Replace the host with your own app URL when self-hosting.

Reserve credits

POST /api/v1/embed/usage/reserve Authorization: Bearer <FRAMETIC_EMBED_USAGE_KEY> Content-Type: application/json { "organizationId": "uuid", "idempotencyKey": "render-job-abc", "units": 2 }
Response 201 (first call) or 200 (idempotent replay):
  • units — render units in Frametic's native billing unit (not credits). Aveiro converts with the same creditsForUnits table as hub-initiated renders.
  • idempotencyKey — retries with the same key return the original reservation and charge nothing further.
  • 402 — organization is over its AI credit quota for the billing period.
Reserve is a debit, not a hold: credits leave the ledger immediately, matching the hub-initiated render path.

Settle a reservation

POST /api/v1/embed/usage/settle Authorization: Bearer <FRAMETIC_EMBED_USAGE_KEY> Content-Type: application/json { "organizationId": "uuid", "reservationId": "uuid", "actualUnits": 1, "failed": false }
Response 200:
  • actualUnits — units actually consumed. If lower than reserved, the difference is refunded. Values above the reservation settle with zero refund (no second debit).
  • failed: true — refunds the full reserved amount; state is refunded.
  • Settling twice is safe — only the first close refunds.

Typical flow

  • Satellite is about to enqueue a render → reserve with an idempotency key tied to the job
  • Render completes → settle with actualUnits
  • Render fails or is cancelled → settle with failed: true

Related

  • Website mockup video API — agent and MCP path for filming URLs into the social library
  • Frametic Studio — human-facing editor surface
{
  "reservationId": "uuid",
  "credits": 100,
  "replayed": false
}
{
  "refunded": 50,
  "state": "settled"
}