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

# Get Started with the Varo Cloud API

> Make your first Varo Cloud API request in under 5 minutes. Generate an API key and run your first model to create an image or video.

This guide walks you through everything you need to make your first authenticated request to the Varo Cloud API — from generating a key to running a model and getting back a result.

<Info>
  **Base URL:** `https://inference.varo.cloud/v1` — all endpoints in this guide are relative to it.
</Info>

## Prerequisites

Before you start, make sure you have:

<CardGroup cols={2}>
  <Card title="A Varo Cloud account" icon="user" href="https://varo.cloud/auth">
    [Sign up](https://varo.cloud/auth) if you don't have one yet — the free tier is enough to start building with multiple models.
  </Card>

  <Card title="An API key" icon="key">
    Generate an `sk_live_` key from your dashboard. You'll pass it as a Bearer token on every request.
  </Card>

  <Card title="curl or a language runtime" icon="terminal">
    Any HTTP client works. Examples below use curl, Node.js, and Python.
  </Card>

  <Card title="5 minutes" icon="clock">
    That's all it takes to go from zero to your first generated asset.
  </Card>
</CardGroup>

## Step 1: Generate an API Key

All requests to the Varo Cloud API are authenticated with a bearer token. To create one:

<Steps>
  <Step title="Open the dashboard">
    Sign in at [varo.cloud/auth](https://varo.cloud/auth) and open **API Keys** in your dashboard.
  </Step>

  <Step title="Create a new key">
    Click **Create key**, give it a descriptive name (e.g. `local-dev` or `ci-pipeline`), and choose the scopes it needs.
  </Step>

  <Step title="Copy and store it securely">
    The full key is shown **only once**. Copy it immediately and store it in a secret manager or environment variable — never commit it to source control.

    ```bash theme={null}
    export VARO_API_KEY="sk_live_..."
    ```
  </Step>
</Steps>

<Warning>
  Treat your API key like a password. If a key is ever exposed, rotate it immediately from the dashboard.
</Warning>

## Step 2: Run Your First Generation

Let's create an image. Send a `POST` request to `/v1/generations` with the model you want to run and its inputs. Pass your key in the `Authorization` header as a bearer token:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://inference.varo.cloud/v1/generations \
    -H "Authorization: Bearer $VARO_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "google-nano-banana-pro/text-to-image",
      "prompt": "a cat sitting on a windowsill, golden hour lighting, photorealistic",
      "aspect_ratio": "4:3",
      "output_format": "jpeg",
      "resolution": "1K"
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://inference.varo.cloud/v1/generations", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.VARO_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      model: "google-nano-banana-pro/text-to-image",
      prompt: "a cat sitting on a windowsill, golden hour lighting, photorealistic",
      aspect_ratio: "4:3",
      output_format: "jpeg",
      resolution: "1K",
    }),
  });

  const generation = await response.json();
  console.log(generation.output.url);
  ```

  ```python Python theme={null}
  import os
  import requests

  response = requests.post(
      "https://inference.varo.cloud/v1/generations",
      headers={
          "Authorization": f"Bearer {os.environ['VARO_API_KEY']}",
          "Content-Type": "application/json",
      },
      json={
          "model": "google-nano-banana-pro/text-to-image",
          "prompt": "a cat sitting on a windowsill, golden hour lighting, photorealistic",
          "aspect_ratio": "4:3",
          "output_format": "jpeg",
          "resolution": "1K",
      },
  )

  generation = response.json()
  print(generation["output"]["url"])
  ```
</CodeGroup>

## Step 3: Read the Response

The API returns a **generation object**. When `status` is `completed`, `output.url` points to your finished asset:

```json theme={null}
{
  "id": "9d481365-2b49-4e94-ac9b-c3d2db5b2374",
  "object": "generation",
  "status": "completed",
  "model": "google-nano-banana-pro/text-to-image",
  "created_at": 1783996705,
  "output": {
    "type": "image",
    "url": "https://staging-assets.varo.cloud/generations/.../result.jpeg"
  },
  "usage": {
    "cost_usd": 0.04
  }
}
```

| Field            | Description                                                      |
| ---------------- | ---------------------------------------------------------------- |
| `id`             | Unique identifier for this generation                            |
| `status`         | Generation state — `completed` when the asset is ready           |
| `model`          | The model that produced the output                               |
| `output.type`    | `image` or `video`, depending on the model                       |
| `output.url`     | Direct link to download the generated asset                      |
| `usage.cost_usd` | Cost of this generation, in USD (varies by model and parameters) |

<Warning>
  If you get back a `401 Unauthorized`, double-check that your key is correct, starts with `sk_live_`, and hasn't been revoked. See [Errors](/api-reference/errors) for the full list of response codes.
</Warning>

## Step 4: Try Another Model

The same endpoint runs every model on the platform — just change the `model` field and its inputs. Here's a video model instead of an image one:

```bash theme={null}
curl -X POST https://inference.varo.cloud/v1/generations \
  -H "Authorization: Bearer $VARO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "alibaba-wan-2-7/reference-to-video",
    "prompt": "the cat slowly turns to look at the camera"
  }'
```

The response has the same shape, with `output.type` set to `video`:

```json theme={null}
{
  "id": "9d481365-2b49-4e94-ac9b-c3d2db5b2374",
  "object": "generation",
  "status": "completed",
  "model": "alibaba-wan-2-7/reference-to-video",
  "created_at": 1783996705,
  "output": {
    "type": "video",
    "url": "https://staging-assets.varo.cloud/generations/.../result.mp4"
  },
  "usage": {
    "cost_usd": 0.5
  }
}
```

<Tip>
  One API, one key, one response shape for every model — swap the `model` field to move between image, video, and other modalities without changing your integration.
</Tip>

## Next Steps

You've run your first model and retrieved a result. Here's where to go next:

<CardGroup cols={2}>
  <Card title="Full API Reference" icon="book" href="/api-reference/introduction">
    Browse every endpoint, request schema, and response format.
  </Card>

  <Card title="Authentication Deep Dive" icon="key" href="/api-reference/authentication">
    Learn about key scopes, rotation, and best practices.
  </Card>

  <Card title="Errors" icon="triangle-exclamation" href="/api-reference/errors">
    Understand error codes and how to handle failed generations.
  </Card>

  <Card title="Webhooks" icon="webhook" href="/api-reference/webhooks">
    Receive real-time events instead of polling for status.
  </Card>
</CardGroup>
