API reference

API reference · Credits

Subscribe, switch, resume or cancel

POST/api/account/planSigned in session

`subscribe` with no active plan charges the price to the balance at once (402 `not_funded` for an account that never deposited, 402 `insufficient_credits` when the balance, holds counted, is short). With a plan active, the same plan with its cancellation pending resumes it, another plan switches at the next renewal at that plan's price, and the same plan otherwise is 409 `already_subscribed`. `cancel` stops the next renewal: the paid period runs to its end and nothing is refunded. A renewal the balance cannot cover lapses at the end of the period and sends plan.ended. An account the operator froze is refused every action here but cancel (403 `account_frozen`), and its plan is not renewed: it ends as `frozen` when the paid period does. Same origin only; ten changes a minute.

Request body

application/json, required

Request body fields
FieldTypeWhat it is
actionrequired"subscribe"
planIdrequiredstring

Example

{
  "action": "subscribe",
  "planId": "string"
}

Answer 200

What happened, and the plan as it now stands.

Fields of the 200 answer
FieldTypeWhat it is
okboolean
actionstringOne of "subscribed", "resumed", "scheduled", "cancelled".
planobject
plan.enabledrequiredbooleanFalse unless the operator set ANTIMATTER_PLANS.
plan.periodDaysinteger
plan.baseRpmintegerANTIMATTER_API_RPM, the per key limit without a plan or holder tier.
plan.plansrequiredarray of object
plan.plans[].idstring
plan.plans[].namestring
plan.plans[].priceMicrosintegerWhat one 30 day period costs, from the credit balance.
plan.plans[].rateMultipliernumberMultiplies ANTIMATTER_API_RPM per key.
plan.plans[].includedCreditMicrosintegerCredit added at the start of every paid period; 0 for none.
plan.plans[].requestsPerMinuteintegerThe per key limit this plan gives on this deployment.
plan.plans[].studioobject or nullWhat the plan grants in Nova Studio, or null for nothing. Studio credit is spent on video, sound and 3D jobs before the balance, and on nothing else.
plan.plans[].studio.creditMicrosintegerStudio credit each paid period; 0 for none.
plan.plans[].studio.maxActiveJobsinteger or nullA render plan's shots at once, where the plan raises the deployment's own; else null.
plan.plans[].studio.jobMarkupDiscountBpsintegerOff the margin of every take, never below the provider's price; 0 for none.
plan.currentrequiredobject or nullThe active subscription, paid through periodEnd. Its terms are the ones it was paid on.
plan.current.subscriptionIdinteger
plan.current.planIdstring
plan.current.namestring
plan.current.periodinteger1 for the first paid period, one more per renewal.
plan.current.periodStartinteger
plan.current.periodEndinteger
plan.current.priceMicrosinteger
plan.current.rateMultipliernumber
plan.current.includedCreditMicrosinteger
plan.current.cancelAtPeriodEndboolean
plan.current.nextPlanIdstring or nullA switch waiting for renewal.
plan.current.renewsAtinteger or nullWhen the next charge falls due; null when it will not renew.
plan.current.renewalPriceMicrosinteger or nullWhat that charge will be, from the configuration.
plan.current.studioobject or nullWhat this period grants in Nova Studio and the studio credit left of it, as GET /api/studio/plan answers it; null for nothing.
plan.current.studio.plan_idstring
plan.current.studio.period_endinteger
plan.current.studio.credit_microsinteger
plan.current.studio.credit_left_microsinteger
plan.current.studio.max_active_jobsinteger or null
plan.current.studio.job_markup_discount_bpsinteger
plan.lastEndedrequiredobject or nullWith no active plan, how the last one ended.
plan.lastEnded.planIdstring
plan.lastEnded.namestring
plan.lastEnded.endedAtinteger
plan.lastEnded.reasonstringOne of "cancelled", "lapsed", "withdrawn", "frozen".
plan.lastEnded.periodEndinteger

Errors

  • 400OpenAI shaped error.
  • 401OpenAI shaped error.
  • 402OpenAI shaped error.
  • 403OpenAI shaped error.
  • 404OpenAI shaped error.
  • 409OpenAI shaped error.
  • 429OpenAI shaped error.
  • 503OpenAI shaped error.

Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.

Antimatter