> For the complete documentation index, see [llms.txt](https://bountyv.gitbook.io/vdocs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bountyv.gitbook.io/vdocs/quickstart.md).

# Quickstart

Make your first API call in under 5 minutes.

## 1. Get your API key

API keys are issued manually. Once you have one, it looks like:

```
sk_live_abc123def456ghi789jkl012mno345pqr678
```

Treat it like a password — never commit it to source control.

## 2. Check your balance

```bash
curl https://substance-api.com/api/v1/credits \
  -H "Authorization: Bearer sk_live_..."
```

Response:

```json
{
  "currency": "V-Tokens",
  "unlimited": false,
  "balance_tokens": 5000,
  "balance_cents": 5000,
  "pricing": {
    "identity_image": { "charge_cents": 25 },
    "video_generate": { "charge_cents": 250 },
    "thumbnail": { "charge_cents": 20 }
  }
}
```

Everything is priced in **V-Tokens**. `5000` means 5,000 tokens — and since 1 V-Token = 1 US cent, that is $50.00 of credit. The `*_cents` fields carry the same numbers and remain for existing integrations. Pricing keys vary by the products enabled on your account — see [Credits & pricing](/vdocs/account/credits.md).

## 3. Generate an image

The simplest image call is text-to-image — just send a prompt:

```bash
curl -X POST https://substance-api.com/api/v1/images/txt2img \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"prompt": "a woman on a beach at sunset, cinematic", "engine": "zimage", "aspect": "4:5"}'
```

Response (truncated):

```json
{
  "image": "https://.../generations/abc.png?token=...",
  "generation_id": "gJ8nP3kQ2m",
  "charged_cents": 25,
  "balance_cents": 4975
}
```

The `image` field is a time-limited signed URL (or an inline `data:` URL if storage is unavailable) — download it or display it directly. Pick an engine, aspect ratio, or LoRA stack per [Text-to-Image](/vdocs/image-api/images-txt2img.md). To edit or animate an uploaded image instead, see [Image Edit](/vdocs/image-api/images-edit.md), [Image-to-Image](/vdocs/image-api/images-i2i.md), and [Image-to-Video](/vdocs/image-api/images-img2video.md).

The `image` field is a base64-encoded PNG. Save it to a file, display it inline, or upload it to your own storage.

## 4. Generate a video

Videos are asynchronous. You submit a job and poll for the result.

**Submit:**

```bash
curl -X POST https://substance-api.com/api/v1/videos/generate \
  -H "Authorization: Bearer sk_live_..." \
  -F "face=@/path/to/face.jpg" \
  -F "reference_video_url=https://www.tiktok.com/@user/video/12345"
```

Response:

```json
{
  "job_id": "nH7bK9xQ2m",
  "status": "queued",
  "charged_cents": 85,
  "balance_cents": 4845,
  "poll_url": "/api/v1/jobs/nH7bK9xQ2m"
}
```

**Poll until done:**

```bash
curl https://substance-api.com/api/v1/jobs/nH7bK9xQ2m \
  -H "Authorization: Bearer sk_live_..."
```

Status progresses `queued` → `processing` → `completed`. When complete, the response contains a `video_url`:

```json
{
  "job_id": "nH7bK9xQ2m",
  "status": "completed",
  "progress": 100,
  "video_url": "https://.../final.mp4"
}
```

## 5. Top up when you run low

```bash
curl -X POST https://substance-api.com/api/v1/topup \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"amount_usd": 100, "crypto_asset": "usdttrc20"}'
```

Response:

```json
{
  "topup_id": "abc123",
  "invoice_url": "https://nowpayments.io/payment/?iid=...",
  "status": "pending"
}
```

Open `invoice_url` in a browser and pay with crypto. Your balance is credited automatically once the payment confirms on-chain (typically 1–15 minutes).

Minimum top-up is **$25 USD**. Supported assets include `usdttrc20` (recommended), `btc`, `eth`, `ltc`, and more.

## Next steps

* Full [API Reference](/vdocs/api-reference/api.md)
* [Examples](/vdocs/examples.md) in Python, Node.js, and cURL
* [Error codes](/vdocs/errors.md) and retry guidance


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://bountyv.gitbook.io/vdocs/quickstart.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
