Skip to main content
Every V1 request needs an API key in the Authorization header. Keys start with sk-.

Create and store a key

Create and revoke keys in the Viggle Dashboard. Keys can belong to you or to an organization:
  • A personal key spends your personal credits, including the 100 free credits new accounts get.
  • An organization key spends the organization’s credits, plus the balance of an active contract if the key is assigned to one.
Keep keys in a server-side environment variable or secret store. Never put them in browser code, mobile apps or public repositories. Anyone with the key can spend its credits. The API does answer browser CORS requests, but call it from your own server and keep the key there.

What a key can see

Jobs and 3D outputs belong to the key that created them. 2D assets and scenes belong to the account. If you rotate keys, finish or download the jobs started with the old key first, and export your 3D characters and motions before you revoke it. 2D characters and motions and scenes carry over to the new key.

Per-key credit limits

A key can carry two optional spending caps:
  • A credit limit: the most the key can spend over its lifetime.
  • A monthly credit limit: the most it can spend per calendar month (UTC). It resets at the start of each month.
A job that would push the key past either cap is refused the same way as a job your balance can’t cover, with INSUFFICIENT_CREDITS. GET /v1/credits reports the balance capped by what remains of the key’s lifetime limit. See Pricing for which capabilities answer 402 and which fail asynchronously.

Trace requests with X-Request-Id

Every response carries an X-Request-Id header. Send your own value to correlate the request with your logs; otherwise Viggle generates one. The same ID appears as request_id in error bodies.
Include the request ID when you contact support.

Authentication errors

A missing, malformed, revoked or expired key answers 401 with UNAUTHENTICATED. The message is Authentication required when the header is missing and Invalid or expired API key otherwise:
Check that the header reads Authorization: Bearer sk-... with no extra quotes or whitespace, and that the key is still active in the Dashboard. If the authentication service itself is briefly unavailable, you get 503 SERVICE_BUSY with retryable: true; retry with backoff. See Errors for every code.

Next steps

Quickstart

Make your first request with your new key.

Pricing

What each operation costs and how credits are reserved.