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

# Quickstart

> Make your first image and video in a few minutes.

## Get a key

Open [Studio → API](https://studio.superscore.ai/?view=api) and choose **Create key**. You'll see the secret only once, so copy it then. For trying the docs, choose a one-hour key.

```bash theme={null}
export STUDIO_API_KEY="sk_studio_…"
```

## Fund your organization

A key doesn't come with money. Requests draw from your organization's prepaid API balance, and a request your balance doesn't cover gets `402 insufficient_balance`. Self-serve top-up isn't available yet: during the pilot, ask your Superscore contact for a starter grant of API balance, which the Superscore team gives from your organization's API page.

Continue once your balance covers a request:

```bash theme={null}
curl https://studio.superscore.ai/api/v1/usage \
  -H "Authorization: Bearer $STUDIO_API_KEY"
```

## Generate an image

Make one Idempotency-Key per job, once, in its own step:

```bash theme={null}
KEY=$(uuidgen)
```

Then send the request. If it times out, rerun **only the `curl` command**: the same key and body get you the original generation back instead of paying twice. Run the `KEY=` line again only for a new job.

```bash theme={null}
curl -i https://studio.superscore.ai/api/v1/generations \
  -H "Authorization: Bearer $STUDIO_API_KEY" \
  -H "Idempotency-Key: $KEY" \
  -H "Content-Type: application/json" \
  -d '{"type": "image", "prompt": "A ceramic espresso cup with a cobalt handle"}'
```

The answer is `202 Accepted`. Its `Location` header is where to poll, and its body is the generation:

```json theme={null}
{
  "id": "6f1c2a90-…",
  "object": "generation",
  "type": "image",
  "model": "qwen-image-2.1",
  "status": "queued",
  "outputs": [],
  "billing": { "state": "held", "max_usd": 0.02, "charged_usd": null }
}
```

## Check on it

Set `GENERATION_ID` to the `id` from your own response (the end of its `Location`). Poll it, waiting the `Retry-After` seconds between reads. Reading a generation is never charged.

```bash theme={null}
GENERATION_ID="<the id from your response>"
curl -i "https://studio.superscore.ai/api/v1/generations/$GENERATION_ID" \
  -H "Authorization: Bearer $STUDIO_API_KEY"
```

When `status` is `succeeded`, download each `outputs[].url` before its `expires_at`. Read the generation again any time for a fresh link. You never send your Studio key to the storage host.

## Generate a video

Make a new key for this new job, then send it; on a timeout, rerun only the `curl` command.

```bash theme={null}
KEY=$(uuidgen)
```

```bash theme={null}
curl -i https://studio.superscore.ai/api/v1/generations \
  -H "Authorization: Bearer $STUDIO_API_KEY" \
  -H "Idempotency-Key: $KEY" \
  -H "Content-Type: application/json" \
  -d '{"type": "video", "prompt": "A slow push toward a cup on a sunlit counter", "duration": 5}'
```

Clips last 2 to 8 seconds. Poll the same way. Videos take longer, so `Retry-After` is longer too.

## Use provider parameters

Send the model's own body at the top level. Studio passes along each setting you send, including your prompt exactly as written, leaves out what you leave out, and refuses any field it doesn't support, naming that field. Studio always runs requests with reAPI's content filter on.

Make a new key for each job first (`KEY=$(uuidgen)`), and on a timeout rerun only the `curl` command.

```bash Image theme={null}
curl -i https://studio.superscore.ai/api/v1/providers/reapi/images/generations \
  -H "Authorization: Bearer $STUDIO_API_KEY" \
  -H "Idempotency-Key: $KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-image-2.1",
    "prompt": "A ceramic espresso cup with a cobalt handle, isolated",
    "resolution": "1K",
    "background": "transparent",
    "output_format": "png"
  }'
```

```bash Video theme={null}
curl -i https://studio.superscore.ai/api/v1/providers/reapi/videos/generations \
  -H "Authorization: Bearer $STUDIO_API_KEY" \
  -H "Idempotency-Key: $KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "wan3.0-video",
    "prompt": "A slow push toward a ceramic cup on a sunlit counter",
    "duration": 5,
    "resolution": "720P",
    "size": "16:9",
    "audio": false,
    "seed": 0
  }'
```

## In Python

```python theme={null}
import os, time, requests

API = "https://studio.superscore.ai/api/v1"
headers = {"Authorization": f"Bearer {os.environ['STUDIO_API_KEY']}"}


def checked(response):
    """The generation, or the API's error code and message."""
    if response.ok:
        return response.json()
    try:
        body = response.json()
    except ValueError:  # a gateway's HTML error page
        body = None
    error = body.get("error") if isinstance(body, dict) else None
    if isinstance(error, dict) and "code" in error and "message" in error:
        raise RuntimeError(f"{response.status_code} {error['code']}: {error['message']}")
    # Any other shape, such as a gateway's own JSON: keep the status.
    raise RuntimeError(f"{response.status_code}: {response.text[:200]}")


# One key per job, made once and kept outside the script (export
# STUDIO_IDEMPOTENCY_KEY=$(uuidgen)), so rerunning it after a timeout reuses it
# and is never charged twice. Make a new key only for a new job.
key = os.environ["STUDIO_IDEMPOTENCY_KEY"]
timeout = (5, 30)  # connect, read

response = requests.post(
    f"{API}/generations",
    headers={**headers, "Idempotency-Key": key},
    json={"type": "image", "prompt": "A ceramic espresso cup with a cobalt handle"},
    timeout=timeout,  # on a timeout, rerun: the same key returns the same job
)
job = checked(response)

while job["status"] in ("queued", "running"):
    time.sleep(int(response.headers.get("Retry-After", 5)))
    try:
        response = requests.get(
            f"{API}/generations/{job['id']}", headers=headers, timeout=timeout
        )
    except requests.Timeout:
        continue  # keep polling the same generation
    job = checked(response)

print(job["status"], [output["url"] for output in job["outputs"]])
```


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