BevylDevelopers

Errors

Status codes and error bodies.

The SDK throws BevylApiError on any non-2xx response. It carries the HTTP status, the error code when the API sends one, and the raw body.

import { BevylApiError } from '@bevyl-ai/bevyl-sdk';

try {
  await bevyl.createProject(input);
} catch (error) {
  if (
    error instanceof BevylApiError &&
    error.code === 'insufficient_partner_credits'
  ) {
    // add funds in the partner portal
  }
  throw error;
}

Status and error codes

StatusCodeWhat to do
400Fix the request. For a body that fails validation, issues lists each problem.
401Send a valid, unrevoked API key.
402insufficient_partner_creditsAdd funds in the partner portal.
402limit_gate_deniedThe workspace reached a plan limit. Contact Bevyl.
402Upload: the workspace reached its plan's upload limit.
402export_paywall, plan_limit_exceeded, free_limit_exceeded, trial_expired, account_access_suspendedstartExport: the workspace plan doesn't allow the export. error.message says why.
403Create the workspace first. Check it isn't another partner's or revoked.
404The workspace has no brand, or the project, upload, or export isn't in it.
404project_not_foundCheck the projectId and workspaceId.
404not_foundCheck the ID you sent.
409createWorkspace: the ID belongs to another partner or is revoked. completeVideoUpload: finish the file PUT and call it again, or start a new upload if this one expired.
409generation_in_progressWait for project generation to finish, then regenerate.
409analysis_not_readyRetry in a few seconds.
409analysis_failedAnalysis failed. error.message says why.
422Upload: the file type or size isn't allowed. Export: the project is longer than the workspace plan allows. Music preview: pick a track from listBackgroundMusic.
422preflight_deniedWait until the source videos are processed. error.message says why.
422voice_unavailablePick a voice from listVoices.
422trend_unavailablePick a trend from listTrends.
422background_music_unavailablePick a track from listBackgroundMusic.
422no_prior_generationCall createProject first. Regenerate needs a prior brief.
422invalid_briefFix the brief. error.message says what is wrong.
500A Bevyl error. Retry with backoff.
502export_dispatch_failedCall startExport again.

uploadVideo throws BevylApiError with code upload_put_failed when the file PUT fails.

Error bodies

Validation errors:

{
  "error": "Invalid request body",
  "issues": [
    {
      "code": "invalid_type",
      "path": ["name"],
      "message": "Invalid input: expected string, received undefined"
    }
  ]
}

Operation errors:

{ "ok": false, "error": { "code": "analysis_not_ready", "message": "…" } }

Other errors:

{ "error": "Unauthorized" }

On this page