Sign up free
Documentation
Type to search. Use the down arrow to browse results, or Escape to close them.

Errors

Recognize authentication, allowance, upload, and service failures, then choose a useful recovery.

Error shape

{
  "error": "The API key is invalid or revoked.",
  "code": "invalid_api_key"
}

Use the HTTP status and code for application logic. The error string is a readable explanation; avoid matching its exact text.

Status codes

Status Typical code What to do
400 image_required, invalid_multipart, invalid_idempotency_key Send one file in image, let the client set its multipart boundary, and check the request ID format.
401 unauthorized, invalid_api_key Supply a valid Authorization: Bearer vt_live_... header from your server.
402 api_plan_required, api_quota_exhausted Check monthly allowance and granted API credits in the dashboard. Either can fund a conversion. Web export credits do not cover API calls.
403 untrusted_origin Call from your server. Arbitrary browser origins are not permitted.
409 conversion_in_progress Wait, then retry the same conversion with the same idempotency key.
409 idempotency_conflict The completed ID belongs to different image bytes. Keep the original bytes for a retry; use a new ID only for a deliberate new conversion.
409 result_unavailable A completed request’s saved output is unavailable. Start a new conversion with a new key.
413 payload_too_large Reduce the upload to 10 MiB or less; the complete multipart request also has an overhead limit.
415 unsupported_image Export a real PNG, JPG, GIF, BMP or WebP. Renaming a file is not conversion.
422 image_dimensions, invalid_image Check the server API image limits, or re-export a damaged image.
429 concurrency_limited Wait for an existing account job to finish; respect Retry-After. Conversions and PDF/EPS/DXF exports share the cap.
429 rate_limited Wait for Retry-After (seconds); preserve the image and request ID. REST, MCP, dashboard requests and signed downloads share account limits.
500 internal_error Preserve the file and request ID, then retry later with the same key.
502 engine_unavailable, invalid_engine_response Retry later with the same key. No usable result was delivered.
503 engine_busy Back off before retrying with the same key. Avoid parallel retries.

An infrastructure failure may return a different status or a non-JSON response. Handle that case without assuming every response contains an error property.

Handle failures safely

After making an authenticated request as shown in the code examples, check both the status and the body before using the result:

const result = await response.json().catch(() => null);

if (!response.ok) {
  const message = result?.error ?? "Conversion failed. Please try again.";
  throw new Error(message);
}
if (typeof result?.svg !== "string") {
  throw new Error("The server returned an unexpected response.");
}

Show a useful error while keeping the selected file available. Avoid displaying an API key or authorization header in logs or user-facing errors.

Retrying

Correct invalid credentials, inactive plans, and invalid inputs before retrying. For network or service failures, use a deliberate retry with the original Idempotency-Key. Apply a delay between attempts and stop retrying if your application no longer needs the result.

An application timeout does not establish whether the server completed the conversion. A retry with the same key can recover a completed result without charging twice. See idempotency.

MCP tool failures

MCP uses protocol envelopes: a tool can return HTTP 200 with isError: true. Its text content contains JSON with code, error, status, retryable, and next_action. Rejected file locations also include attachment_host, containing only the hostname, to help support diagnose handoffs without sharing signed URLs. Retriable failures also include retry_after_seconds; allowance failures include manage_url. Authentication and request-window throttling may instead fail before the tool runs, with HTTP 401 or 429.

  • invalid_file_url, unsupported_file_host, file_unavailable, or image_required: attach one original PNG/JPG/GIF/BMP/WebP again. Do not invent download URLs or encode the image in the conversation.
  • conversion_in_progress, rate_limited, concurrency_limited, engine_unavailable, or engine_busy: follow the returned delay and preserve the same input and request ID. Stop after two retries.
  • api_plan_required or api_quota_exhausted: correct the account allowance; tools cannot buy a plan.
  • download_expired: use get_conversion to refresh the saved SVG link.

The automatic MCP request ID follows the exact original image bytes. Reattaching the same file preserves retry protection even when its temporary URL changes. REST clients must retain their explicit Idempotency-Key. See agents and MCP and rate limits.

A useful next step? Read the journal