When a VidMage request fails, check the HTTP status, errorType, and any recovery instructions in the response. These details tell you whether to correct the request, update your account, wait before retrying, or recover an existing task.
The REST API and VidMage MCP use the same API key and credit balance, but return errors in different formats. This guide covers both, with checks you can run before attempting another generation.
Common VidMage API and MCP Errors and Where to Start
What you see | Error codes | What to check first |
|---|---|---|
VidMage rejects your key or header | 401 NEED_API_KEY (REST), AUTHENTICATION_REQUIRED, AUTHORIZATION_HEADER_INVALID, API_KEY_INVALID_OR_REVOKED, API_KEY_INVALID_CREDENTIAL, ACCOUNT_SESSION_REFRESH_REQUIRED | The key and header your app sends |
VidMage refuses a valid key | 403 NEED_SUBSCRIBE | The subscription on the account that owns the key |
You don't have enough credits for the task | 402 NEED_PURCHASE_CREDITS | Your balance and a fresh quote for the same settings |
VidMage rejects the request as invalid | 400 INVALID_JSON, VALIDATION_ERROR, 404 CAPABILITY_NOT_ENABLED | The field listed in details and the capability's current schema |
VidMage can't use your file or media link | 409 UPLOAD_NOT_READY, 410 UPLOAD_EXPIRED, 400 VALIDATION_ERROR | Upload state, file type, file size, and the link itself |
You can't find VidMage tools in your AI client | AUTHENTICATION_REQUIRED, or no error at all | The client's configuration, the server switch, and the client logs |
Your request times out, you lose the response, or VidMage can't confirm the outcome | SUBMISSION_OUTCOME_UNKNOWN, BILLING_OUTCOME_UNKNOWN, 429 RATE_LIMITED | Retry timing, any saved task ID, and recent tasks |
How to Read a VidMage Error Response
The HTTP status tells you what kind of problem occurred, while errorType identifies the specific cause. VidMage may also include a recovery value that tells you what to do next. Check out the error reference guide to understand unfamiliar codes in more detail. Save the response and any task ID so you have them if you need support.
A REST error response includes errorType alongside its message. For example, a request to https://vidmage.ai/api/v1/capabilities without an API key returns HTTP 401, which means authentication failed:
{
"success": false,
"message": "Invalid or missing API key.",
"errorType": "NEED_API_KEY"
}
REST responses also include an X-Request-Id header that helps VidMage support trace the request. This is different from the task ID used to check generation progress, so keep both when they are available.
Your MCP client sends your API key in the Authorization header. If that header has the wrong format, VidMage returns an error. The excerpt below shows how errorType identifies the problem and recovery points to the fix:
{
"jsonrpc": "2.0",
"id": null,
"error": {
"code": -32001,
"data": {
"errorType": "AUTHORIZATION_HEADER_INVALID",
"recovery": "FIX_AUTHORIZATION_HEADER",
"credentialReceived": false,
"taskSubmitted": false
}
}
}
In this response, taskSubmitted: false confirms that VidMage did not submit a generation task.
Fix API Authentication Errors
For REST, 401 NEED_API_KEY covers both a missing key and an invalid one. MCP provides more specific codes:
- AUTHENTICATION_REQUIRED: The client did not send an API key. Add the key to that client's credential settings and check that its requests include the Authorization header.
- AUTHORIZATION_HEADER_INVALID: VidMage received a header but could not read it. Format it exactly as Authorization: Bearer YOUR_API_KEY, with a single space after Bearer and no line break.
- API_KEY_INVALID_OR_REVOKED or API_KEY_INVALID_CREDENTIAL: VidMage cannot use the key. Create a new dedicated API key in the Developer Console, replace the key in your app's credential settings, and reload the app.
- ACCOUNT_SESSION_REFRESH_REQUIRED: Sign in to your VidMage account once to refresh the session. Keep the API key already configured in your app.
These checks apply to the app sending the request. A browser login does not supply an API key to a separate script or MCP client. If you store the key in an environment variable, make sure the running app can read it.
NOTE: Do not paste your API key into an AI chat. Add it through the app's credential settings.
How to verify the fix: Request the list of available capabilities. This checks access without creating a task or spending generation credits. In your MCP client, ask the agent to call list_capabilities with a limit of 3.
For an optional REST check, run the following command in a terminal where VIDMAGE_API_KEY contains your key:
curl --fail-with-body --silent --show-error --include \
-H "Authorization: Bearer ${VIDMAGE_API_KEY}" \
"https://vidmage.ai/api/v1/capabilities"
A successful response lists the available capabilities. The terminal command confirms REST access. For MCP, a successful list_capabilities call inside the client confirms that the client can use VidMage.
Fix Subscription Access Errors
A 403 NEED_SUBSCRIBE response means the account associated with your API key needs an active subscription. Open the Developer Console and check that account's plan. Activate or renew the subscription, then retry with your existing key.
If you use several VidMage accounts, check which one owns the key in your app. The subscription must be active on that account.
NOTE: The errorType matters here: NEED_SUBSCRIBE points to the subscription, while another 403 code may indicate a different access restriction, such as an organization policy.
How to verify the fix: Request the capability list again. A successful response confirms that access has been restored.
Fix Insufficient Credits Errors
A 402 NEED_PURCHASE_CREDITS response means the task costs more credits than your account currently has. VidMage uses a shared credit balance across its website, API, and MCP, so activity in any of them can affect the amount available.
The Developer Console shows your current balance. You can add credits or reduce the task's cost with supported settings, such as a shorter video or a lower resolution. Check the price for the exact settings you intend to use:
- In MCP: Ask the agent to quote the task before submitting it. It can use estimate_capability_credits for feature capabilities or estimate_model_credits for models. Neither tool starts a generation.
- For REST: Compare your settings with the credit cost on the capability's reference page.
Before retrying a generation, check whether the earlier submission created a task. If you have a task ID or an uncertain submission result, follow the recovery steps below.
How to verify the fix: Confirm that the available balance covers the quoted cost. This check does not require a new generation.
Fix Invalid Parameter Errors
INVALID_JSON means VidMage could not read the request body as valid JSON, often because of a missing comma or quotation mark. VALIDATION_ERROR means one or more inputs do not meet the capability's requirements. The details field identifies what needs correcting.
Each capability has an input schema, including the fields, required values, and supported options it accepts. For REST, these requirements appear in the capability's API reference. In MCP, the agent can retrieve them with describe_capability.
The Text to Image capability accepts prompt and aspectRatio, but its schema does not support the 16:10 ratio or the resolution and format fields. That makes the following input invalid:
{
"prompt": "A vase of flowers on a wooden table.",
"aspectRatio": "16:10",
"resolution": "1k",
"format": "png"
}
Using the supported 16:9 ratio and removing the extra fields gives this corrected input:
{
"prompt": "A vase of flowers on a wooden table.",
"aspectRatio": "16:9"
}
These examples show the inputs for Text to Image, not a complete API request. Other capabilities may accept different fields and settings.
For 404 CAPABILITY_NOT_ENABLED, refresh the capability list and choose one that is currently available.
How to verify the fix: Before you submit, ask the agent to compare your request with the schema:
Inspect the current input schema for the selected VidMage capability and compare it with my request. Identify unsupported fields, missing required values, and invalid options. Show the corrected inputs without uploading media or submitting a generation task.
Fix Inaccessible Media and Upload Errors
VidMage needs a URL it can download directly. A link to a sharing page or a file that requires a browser login may not give it access to the media. Opening the link in a private browser window is a useful first check: it should display the media without asking you to sign in.
For a file on your computer, use VidMage's upload flow to obtain a fileUrl. Pasting a desktop path into a URL field will not upload the file.
Upload the file in three steps:
- Prepare the upload with POST /api/v1/files/upload. Specify the capability, the input field the file belongs to, and the file's name, content type, and size.
- Transfer the file to the returned uploadUrl using the method and headers VidMage provides.
- Use the returned fileUrl in the generation request, in the same input field you specified when preparing the upload.
Note: The storage transfer uses only the upload headers returned by VidMage. Do not add your VidMage API key to that request.
In MCP, the agent can prepare one to five files with upload_files. It then runs the returned upload commands and confirms that the transfers succeeded before submitting the generation request.
The error code tells you which part of the upload needs attention:
- 409 UPLOAD_NOT_READY: The file transfer is not complete. Check the transfer result and complete any failed or unfinished upload before using fileUrl.
- 410 UPLOAD_EXPIRED: Your temporary upload expired. Start a new upload and send the file again.
- 400 VALIDATION_ERROR: The details you sent do not match the file or the input. Compare the file's real size and content type with the values you sent, and confirm that you used the right capability and parameter.
If you are unsure whether a generation request went through, check for an existing task before submitting again.
How to verify the fix: Check that the file transfer completed successfully and that your request uses fileUrl in the intended input field.
Fix Missing VidMage MCP Tools
Missing tools can mean the client has not loaded the VidMage server, could not connect to it, or failed authentication. Check the server entry in the client you are using:
- Server address: Use https://vidmage.ai/api/mcp with Streamable HTTP, rather than the legacy SSE transport.
- Authentication: Use Authorization: Bearer YOUR_API_KEY, with your own key in place of the placeholder.
- Configuration: Check that the file uses valid JSON or TOML, as required by your client, with a single vidmage entry.
- Server status: Enable VidMage in the client's MCP settings.
- Environment variables: If the configuration reads the key from a variable, confirm that the running client can access it.
The configuration format depends on the client. Use the setup guide for Claude Code, Codex, or Cursor to check the server entry.
NOTE: VidMage's API-key connection uses a Bearer header. It does not require an OAuth sign-in.
Save the configuration, then reload or restart the client so it can load the changes.
How to verify the fix: In a new conversation, ask the agent to list VidMage's capabilities without generating anything:
Use the VidMage MCP server configured in this client to call list_capabilities with a limit of 3. Show the returned capability names. Do not upload files or create a generation task. If the connection fails, report the error without switching to REST or another service.
A successful tool call returns available capability names, as shown in the Cursor’s example. Your list may contain different capabilities.

If the tool check fails, open the client's MCP logs to see whether it could reach VidMage and load the tools. In Cursor on a Mac, open the IDE, press Command + Shift + P, choose Output: Show Output Channels, and select MCP: user-vidmage.
A connected=true entry shows that Cursor reached the server. The log's auth=unknown label alone does not tell you whether the API key worked; use a successful list_capabilities call to confirm access.

Once list_capabilities succeeds, you can continue creating videos and images with VidMage MCP.
Recover an Existing Task Before You Submit Again
A timeout or lost response does not necessarily mean generation failed. VidMage may have accepted the request before your app lost the connection. Check the existing task before submitting again to avoid starting a second paid generation.
- Timeouts: Query the saved task ID to check progress. Keep the original request and idempotency key while you recover the result.
- Lost submit response: Find the task with get_recent_tasks in MCP, or GET https://vidmage.ai/api/v1/tasks/recent?limit=10 in REST. Then use its task ID to check the status.
- Idempotency keys: REST uses the Idempotency-Key header, while MCP uses the idempotencyKey argument. Keep the original value when retrying an unchanged request. Use a new value for a separate generation.
- 429 RATE_LIMITED: Wait for the delay in Retry-After. If rate limiting continues, increase the gap between attempts up to a fixed maximum. For MCP status checks, wait at least retryAfterMs milliseconds before checking again.
- 409 IDEMPOTENCY_IN_PROGRESS: VidMage is still handling the original submission. Wait for the delay it specifies and keep the same idempotency key.
- NEEDS_INPUT: The face-swap task needs a face selection. Ask the agent to use select_faces with your choice to continue the existing task.
- Missing download or preview: Query the existing task again and retrieve its result. A missing preview or interrupted download is not a reason to submit another generation.
If VidMage returns SUBMISSION_OUTCOME_UNKNOWN, BILLING_OUTCOME_UNKNOWN, or REFUND_OUTCOME_UNKNOWN, it has not confirmed what happened to the submission, charge, or refund. Follow its recovery instructions, such as GET_RECENT_TASKS, and keep the original idempotency key. Resolve that uncertainty before requesting a replacement generation or another refund.
Some service errors need a different response:
- BILLING_INVARIANT_FAILED: Contact support before making another attempt. Keep the original API key and idempotency key.
- CREDENTIAL_STORAGE_UNAVAILABLE: Keep your current API key, wait for the Retry-After delay, and retry the connection once. If the error continues, contact support with the request ID.
You can ask your MCP agent to recover the task with this prompt:
Inspect the saved request, task ID, original idempotency key, and returned recovery instruction. If the submission result is missing, check my recent VidMage tasks. Continue the existing task where possible and report its status. Do not submit a new generation.
What to Send VidMage Support
If the problem continues after these checks, contact VidMage support with the details below. The following information can help the support team locate the request and understand where it failed:
- Your client and version, or the language and HTTP library used by your script
- The HTTP status, errorType, and recovery value
- The X-Request-Id from the REST response, if you have one
- The capability or model you called
- The task ID or other operation identifier returned by VidMage
- Your original idempotency key or business ID, if support asks for it
Note: Remove your API key, full Authorization header, signed upload URLs, and unrelated personal details before sharing logs or screenshots with support.
Try it in VidMage
Open the tool and follow the steps above.

