Error Codes
All API errors return a JSON response with success: false and an error message.
Error Response Format
{
"success": false,
"error": "Description of what went wrong",
"docs": "https://vectosolve.com/developers"
}HTTP Status Codes
| Status | Code | Description |
|---|---|---|
| 400 | bad_request | Missing or invalid parameters. Check the error message for details. Validation runs before the charge — a 400 never charges. |
| 401 | unauthorized | Invalid, missing, inactive, or revoked API key — or a browser request from an origin not on the key's allowed-origins list. Make sure to include Authorization: Bearer vs_xxx. |
| 402 | insufficient_credits | Not enough credits. The response includes the required amount and a top_up_url. |
| 404 | not_found | Endpoint not found (or unknown job id on GET /api/v1/jobs/{id}). Check the URL path. |
| 409 | duplicate_in_flight | A request with the same Idempotency-Key is still in flight. Wait for it to settle, then retry with the same key to replay its result. |
| 422 | empty_output | The AI returned empty/blank output, or the input had nothing convertible. Automatically refunded — the body carries refunded: true when a charge was reversed. |
| 429 | rate_limited | Too many requests (default 60/minute per key), or a daily spend / monthly usage cap was reached. Check the Retry-After header. |
| 500 | internal_error | Server error. Any charge is automatically refunded. Retry after a short delay; if persistent, contact support. |
| 502 | upstream_error | The generated result could not be retrieved or verified from the AI provider. Automatically refunded (refunded: true) — safe to retry. |
| 503 | service_unavailable | Service temporarily unavailable or throttled. The upstream AI provider may be down. Retry after 30s. |
Retry Strategy
4xx errors (client errors)
Do not retry automatically. Fix the request (missing params, invalid key, insufficient credits) and try again.
429 rate limit
Wait for the duration specified in the Retry-After header, then retry.
5xx errors (server errors)
Safe to retry with exponential backoff. Start with 1s delay, double on each retry, max 3 retries. Credits are automatically refunded on server failures.
Safe Retries with Idempotency-Key
Every paid POST endpoint accepts an optional Idempotency-Key header so a network timeout never risks a double charge:
- Retrying with the same key within 24 hours replays the stored success response instead of re-running (and re-charging) the operation. Replays carry an
Idempotency-Replayed: trueheader. - A concurrent duplicate (same key, first request still running) gets
409. - Failed or refunded runs are never stored — retrying after an error re-runs the operation.
- Success bodies over 100KB are not stored; their replay returns
{ status, too_large: true }. Responses whose result is a time-limited URL (remove-bg, upscale, generate-pattern, batch) replay only within the URL's ~1 hour lifetime.
CORS
The API supports CORS for browser-based requests. By default any origin may call the API, but a key configured with an allowed_origins list rejects browser requests from other origins with 401 (server-to-server calls without an Origin/Referer header always pass). We strongly recommend making API calls from your server to avoid exposing your API key in client-side code.