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
| Field | Type | What it is |
|---|---|---|
| actionrequired | "subscribe" | |
| planIdrequired | string |
Example
{
"action": "subscribe",
"planId": "string"
}Answer 200
What happened, and the plan as it now stands.
| Field | Type | What it is |
|---|---|---|
| ok | boolean | |
| action | string | One of "subscribed", "resumed", "scheduled", "cancelled". |
| plan | object | |
| plan. | boolean | False unless the operator set ANTIMATTER_PLANS. |
| plan. | integer | |
| plan. | integer | ANTIMATTER_API_RPM, the per key limit without a plan or holder tier. |
| plan. | array of object | |
| plan. | string | |
| plan. | string | |
| plan. | integer | What one 30 day period costs, from the credit balance. |
| plan. | number | Multiplies ANTIMATTER_API_RPM per key. |
| plan. | integer | Credit added at the start of every paid period; 0 for none. |
| plan. | integer | The per key limit this plan gives on this deployment. |
| plan. | object or null | What 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. | integer | Studio credit each paid period; 0 for none. |
| plan. | integer or null | A render plan's shots at once, where the plan raises the deployment's own; else null. |
| plan. | integer | Off the margin of every take, never below the provider's price; 0 for none. |
| plan. | object or null | The active subscription, paid through periodEnd. Its terms are the ones it was paid on. |
| plan. | integer | |
| plan. | string | |
| plan. | string | |
| plan. | integer | 1 for the first paid period, one more per renewal. |
| plan. | integer | |
| plan. | integer | |
| plan. | integer | |
| plan. | number | |
| plan. | integer | |
| plan. | boolean | |
| plan. | string or null | A switch waiting for renewal. |
| plan. | integer or null | When the next charge falls due; null when it will not renew. |
| plan. | integer or null | What that charge will be, from the configuration. |
| plan. | object or null | What this period grants in Nova Studio and the studio credit left of it, as GET /api/studio/plan answers it; null for nothing. |
| plan. | string | |
| plan. | integer | |
| plan. | integer | |
| plan. | integer | |
| plan. | integer or null | |
| plan. | integer | |
| plan. | object or null | With no active plan, how the last one ended. |
| plan. | string | |
| plan. | string | |
| plan. | integer | |
| plan. | string | One of "cancelled", "lapsed", "withdrawn", "frozen". |
| plan. | integer |
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.