# Quickstart

From no account to a finished file in three steps.

## 1. Get a key and credits

1. [Sign in](https://opengrid.one/login) and open **API keys** in the dashboard. Create a key. It is shown once, so copy it now.
2. Open **Billing** and add credits. Credits are prepaid; there is no subscription.
3. Export the key in your terminal:

Terminal:

```sh
export OPENGRID_API_KEY=og_live_...
```

## 2. Start a generation and wait for it

`?wait=60` keeps the request open until the job finishes, so a short job comes back done in one call. You are charged only if it succeeds.

curl:

```sh
curl "https://api.opengrid.one/v1/generations?wait=60" \
  -H "Authorization: Bearer $OPENGRID_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "nano-banana-pro",
  "variant": "2k",
  "quantity": 1,
  "input": {
    "prompt": "A paper boat drifting down a rain gutter, golden hour",
    "aspect_ratio": "16:9"
  }
}'
```

Python:

```python
import os, uuid, requests

api = "https://api.opengrid.one/v1"
headers = {"Authorization": f"Bearer {os.environ['OPENGRID_API_KEY']}"}

# Start the job and wait for it. You are charged only if it succeeds.
job = requests.post(
    f"{api}/generations?wait=60",
    headers={**headers, "Idempotency-Key": str(uuid.uuid4())},
    json={
        "model": "nano-banana-pro",
        "variant": "2k",
        "quantity": 1,
        "input": {
            "prompt": "A paper boat drifting down a rain gutter, golden hour",
            "aspect_ratio": "16:9"
        }
    },
).json()

# A long video can outlast one request: keep waiting on the same job.
while job["status"] in ("queued", "running"):
    job = requests.get(f"{api}/generations/{job['id']}?wait=60", headers=headers).json()

print(job["status"], job["outputs"], job["charged_usd"])
```

JavaScript:

```js
const api = "https://api.opengrid.one/v1";
const headers = {
  Authorization: `Bearer ${process.env.OPENGRID_API_KEY}`,
  "Content-Type": "application/json",
};

// Start the job and wait for it. You are charged only if it succeeds.
let job = await fetch(`${api}/generations?wait=60`, {
  method: "POST",
  headers: { ...headers, "Idempotency-Key": crypto.randomUUID() },
  body: JSON.stringify({
    "model": "nano-banana-pro",
    "variant": "2k",
    "quantity": 1,
    "input": {
      "prompt": "A paper boat drifting down a rain gutter, golden hour",
      "aspect_ratio": "16:9"
    }
  }),
}).then((r) => r.json());

// A long video can outlast one request: keep waiting on the same job.
while (job.status === "queued" || job.status === "running") {
  job = await fetch(`${api}/generations/${job.id}?wait=60`, { headers }).then((r) => r.json());
}

console.log(job.status, job.outputs?.[0]?.url, job.charged_usd);
```

200 OK:

```json
{
  "id": "5b0e7c1e-6f0e-4a55-9d9b-3f2a8f1c2d10",
  "status": "succeeded",
  "charged_usd": 0.141225,
  "outputs": [
    {
      "url": "https://api.opengrid.one/v1/generations/5b0e7c1e-.../content/0?exp=1795546991&sig=...",
      "mime": "image/png"
    }
  ],
  "error": null,
  "finished_at": "2026-11-24T18:03:34.009Z"
}
```

A long video can outlast one request. The reply then has `status: "running"`, and you wait on the same job with `GET /v1/generations/{id}?wait=60`, as the Python and JavaScript samples do.

## 3. Download the file

Each `outputs[].url` is a link signed for one hour. Download what you want to keep.

Terminal:

```sh
curl -L -o result.png "OUTPUT_URL"
```

## Where to go next

- [Models and variants](https://opengrid.one/docs/models): how to read the catalog and what a variant is.
- [Estimate a price](https://opengrid.one/docs/estimate): the exact price before you spend.
- [Routing and fallback](https://opengrid.one/docs/routing): which provider runs your job, and what happens when one fails.
- [Use your agent](https://opengrid.one/docs/agents): hand the whole thing to Claude Code, Codex or Cursor.

Source: https://opengrid.one/docs/quickstart
