Treza Billing API
The Billing API from Treza — 1 operation(s) for billing.
The Billing API from Treza — 1 operation(s) for billing.
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/trezalabs-com:trezalabs-com-billing-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. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. 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: Treza Pipelines Billing API
description: 'Treza builds video pipelines from a description. Build pipelines that chain the best AI models (Veo 3.1, Seedance 2.5, Gemini Image, Llama, and any open model) with voiceover, captions, sequencing, and publishing, then call any published pipeline as an API.
Two ways to call a published pipeline:
- Typed invoke: POST /api/pipelines/{id}/invoke with JSON inputs matching the pipeline''s input contract. Returns a runId (HTTP 202); poll GET /api/pipelines/{id}/invoke?runId=... for status and outputs.
- OpenAI-compatible: POST /api/pipelines/{id}/chat/completions works as a drop-in for any OpenAI SDK, streaming included. The latest user message feeds the pipeline and the output returns as the assistant message.
Authentication uses scoped API keys (Bearer treza_live_...) created in the Treza platform or minted over MCP (create_api_key). The key must own the pipeline and the pipeline must be published. Starting a run needs the pipelines:run permission; polling one takes pipelines:read or pipelines:run. Billing is prepaid credits that work across every model; check the balance at GET /api/account/balance, and top up either via a human at the dashboard or, on deployments with x402 enabled, agent-natively at POST /api/billing/credits/x402.
An MCP server is also available at https://www.trezalabs.com/api/mcp (streamable HTTP, OAuth 2.1) exposing tools to list, author, and publish pipelines, inspect runs, trigger new runs, check the credit balance, estimate run cost, and mint scoped API keys (create_api_key, for OAuth connections). Every one of those tools is also plain HTTP with an API key, listed below under /api/v1/tools/{name}: POST the tool''s arguments as the JSON body, with the same key. They list your pipelines, runs and media library, author and publish pipelines, run them, and assemble or edit media.'
version: 3.0.0
contact:
name: Treza Support
url: https://www.trezalabs.com/support
email: hello@trezalabs.com
servers:
- url: https://www.trezalabs.com
description: Production
security:
- bearerAuth: []
tags:
- name: Billing
paths:
/api/billing/credits/x402:
post:
operationId: x402CreditTopUp
x-payment-info:
protocols:
- x402
price:
mode: fixed
currency: USD
amount: '5.00'
summary: Top up credits with an x402 payment (agent-native)
description: 'Adds a fixed amount of Treza credit per call, paid via the x402 protocol (HTTP 402): call without payment to receive a 402 challenge carrying the price and networks, sign the payment with an x402-capable wallet, and retry with the payment-signature header. The challenge lists two ways to pay the same amount: USDC on Base (eip155:8453) first, then USDC on Solana mainnet (solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp); a client pays the first one it has a wallet for, and neither needs gas money in the paying wallet. Grants are idempotent per settled transaction. A bearer (API key, OAuth token, or session) is optional and only chooses which account is credited; without one the credits are keyed to the paying wallet, so an agent holding nothing but a wallet can still fund itself. A Base wallet and a Solana wallet are separate accounts, and their balances are not shared. Only available when the deployment has x402 enabled; the balance endpoint''s x402 field says so.'
responses:
'200':
description: Credits granted
content:
application/json:
schema:
type: object
properties:
grantedUsd:
type: number
description: 0 when duplicate is true.
duplicate:
type: boolean
description: True when this payment was already credited (idempotent replay).
balanceUsd:
type: number
network:
type: string
description: 'Where the payment settled: eip155:8453 (Base) or solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp (Solana).'
transaction:
type: string
description: The settled payment's transaction.
payer:
type: string
description: The paying wallet's address.
'401':
description: A bearer was sent and is invalid (checked before the payment settles, so nothing is taken), or the request carried neither a bearer nor a settled payer
'402':
description: 'Payment required: the challenge response carrying x402 payment instructions'
'429':
description: 'Rate limit exceeded: 30 top-ups an hour per account, or per source address without a bearer'
'500':
description: Internal server error
'503':
description: x402 payments are not enabled on this deployment
tags:
- Billing
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: Scoped API key created in the Treza platform (treza_live_...)
WalletAuth:
type: apiKey
in: header
name: SIGN-IN-WITH-X
x-agentcash-auth-kind: siwx
description: 'Sign-In-With-X (the x402 sign-in-with-x extension, CAIP-122): a wallet''s signed proof of itself, for the free purchases list. Answer the 402 challenge; no payment.'