For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
DashboardAPI PricingGet an API key
  • Guides
    • Introduction
    • Getting started
    • Use with AI agents
    • Examples
    • Authentication
    • Handling async tasks
    • File uploads
    • File hydration
    • Embedding videos
    • Errors
    • Rate limits
    • Libraries & SDKs
  • REST API Reference
    • Overview
    • Workflows
        • POSTGenerate image
        • POSTGenerate video clip
        • POSTText to speech
        • POSTGenerate sound effect
        • POSTGenerate avatar clip
        • POSTVectorize image
        • POSTRemove background from an image
        • POSTRemove background from a video
        • POSTUpscale an image
        • POSTUpscale a video
        • POSTCancel tool execution
        • GETGet tool execution info
        • GETList files
        • POSTSearch files
        • GETGet file
        • POSTCreate file upload
        • POSTHydrate file
        • POSTArchive file
        • POSTEnable public preview
        • POSTDisable public preview
        • GETList avatar presenters
        • GETList TTS voices
        • GETList webhooks
        • POSTCreate webhook
        • DELDelete webhook
  • Webhook events
    • Overview
    • Changelog
LogoLogo
DashboardAPI PricingGet an API key
On this page
  • HTTP status codes
  • Error codes
  • Handling errors in SDKs
Guides

Errors

How the API communicates problems and what to do about them.
Was this page helpful?
Previous

Rate limits

Understand the request limits applied to your API key.
Next
Built with

When a request fails, the API returns a non-2xx HTTP status code with a JSON body matching the ApiError schema:

1{
2 "message": "API key is invalid or has been revoked.",
3 "code": "invalid_api_key"
4}
FieldTypeDescription
messagestringA human-readable explanation. Safe to display to end users.
codestring | undefinedA machine-readable error code in snake_case. Not present on all errors yet — check the HTTP status code as the primary signal.

HTTP status codes

StatusMeaning
400Bad request — invalid parameters, missing required fields, or malformed body
401Unauthorized — missing or invalid API key
403Forbidden — your API key doesn’t have access to this resource
404Not found — the resource doesn’t exist or doesn’t belong to your team
429Rate limit exceeded — back off and retry (see Rate Limits)
500Internal server error — something went wrong on our end

Error codes

CodeTypical statusDescription
missing_api_key401No Authorization: Bearer ... header was provided, or the token is empty
invalid_api_key401The provided API key is invalid or has been revoked
invalid_id400A resource id (file, execution, endpoint) is malformed or has the wrong prefix
invalid_parameters400One or more request parameters failed validation

More codes will be added over time. Always use the HTTP status code as the primary indicator, and treat code as supplemental information for programmatic branching.

Handling errors in SDKs

Both SDKs throw a typed error that includes the HTTP status and the ApiError body:

TypeScript
Python
1import { VideoGenClient, VideoGenError } from "@videogen/sdk";
2
3try {
4 await client.tools.generateImage({ prompt: "" });
5} catch (err) {
6 if (err instanceof VideoGenError) {
7 console.error(err.statusCode); // 400
8 console.error(err.body.message); // "prompt is required"
9 console.error(err.body.code); // "invalid_parameters"
10 }
11}