> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vidgen.id/llms.txt
> Use this file to discover all available pages before exploring further.

# API reference overview

> The five Vigen API endpoints, the standard error shape, and the things that stay consistent across endpoints.

The Vigen API has five endpoints. They all use the same origin, the same authentication, and the same error shape.

| Method | Path | Auth | Responds |
| - | - | - | - |
| `POST` | [`/api/v1/generate`](https://docs.vidgen.id/en/api-reference/generate) | API key | `202` new job, `200` idempotent replay |
| `GET` | [`/api/v1/jobs/{id}`](https://docs.vidgen.id/en/api-reference/get-job) | API key | `200` |
| `POST` | [`/api/v1/upload`](https://docs.vidgen.id/en/api-reference/upload) | API key | `200` asset object |
| `GET` | [`/api/v1/models`](https://docs.vidgen.id/en/api-reference/models) | public | `200` |
| `GET` | [`/api/v1/user/credits`](https://docs.vidgen.id/en/api-reference/credits) | API key | `200` |

## Conventions

* **Base URL** `https://vigen.id`, path prefix `/api/v1`. See [Base URL](https://docs.vidgen.id/en/api-base-url.md).
* **Authentication** through `Authorization: Bearer vg_...` **or** `x-api-key: vg_...`. See [Authentication](https://docs.vidgen.id/en/authentication.md).
* **Content type** `application/json; charset=utf-8`, except uploads, which use `multipart/form-data`.
* **Timestamps** use ISO-8601 UTC (`2026-11-04T09:12:44.000Z`). Daily quotas are counted in WIB.
* **Success bodies** always include `"success": true` next to the data.
* **No CORS**: call from a server, not from a browser.

## Error shape

Every failure uses this body:

```json theme={null} theme={null}
{ "error": "Pesan yang layak dibaca manusia." }
```

What distinguishes them is the HTTP status. Some errors add diagnostic fields:

| Status | Meaning | Extra fields |
| - | - | - |
| `400` | The request could not be understood or failed validation | `fields` (when a parameter is the problem) |
| `401` | Key missing, wrong format, or revoked | — |
| `402` | Not enough credits | `requiredCredits`, `currentCredits` |
| `403` | The job does not belong to this account | — |
| `409` | The model exists but is not active right now | — |
| `413` | The file exceeds 100 MB | — |
| `429` | Concurrency limit, daily quota, queue full, or upload limit | `maxConcurrent`, `activeJobs`, `dailyVideosUsed`, `resetsAt`; `Retry-After` header on upload |
| `500` | A failure on the Vigen side while loading data | — |
| `503` | Maintenance, or the session/credit service is unreachable | — |

> [!NOTE]
>
> Vigen does not issue its own numeric error codes. Do not parse strings for logic — use the HTTP status, then read the diagnostic fields if any are present.

## Error messages never contain internal details

The path to the user is filtered: provider names, internal URLs, and raw responses from upstream systems never appear in `error` or `errorMessage`. What you get is a sentence you can pass straight to an end user. If something looks off, report the `job.id` together with its status.

## OpenAPI spec

There is an OpenAPI 3.1 spec in the documentation repository (`/openapi.json`), provided as an artifact for generating clients. If it conflicts with the pages in this tab, the spec is not the source of truth; the live contract is the server.

## Where to start

> [card] [Generate video or image](https://docs.vidgen.id/en/api-reference/generate.md)
>
> The main endpoint: prompt, model, parameters, references.

> [card] [Fetch a result](https://docs.vidgen.id/en/api-reference/get-job.md)
>
> Poll the status and download the media.

> [card] [Upload a reference](https://docs.vidgen.id/en/api-reference/upload.md)
>
> Images, video, or audio as source material.

> [card] [Read your balance](https://docs.vidgen.id/en/api-reference/credits.md)
>
> Credits, Unlimited period, and the quota left today.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.