---
title: "API"
description: "Create an API key, send your first request, and validate your API setup."
icon: "rocket"
---

Use this guide when integrating with `api.quiver.ai`.

:::note
If you are working directly in `app.quiver.ai`, start with the [App docs](/app).
:::

## Before you begin

Create a QuiverAI public beta account at [quiver.ai/start](https://quiver.ai/start), then sign in to [app.quiver.ai](https://app.quiver.ai).

1. **Create an API key**

    1. Open [API Keys](https://platform.quiver.ai/api-keys) in the Developer Platform.
    2. Click **Create API key** and give it a name.
    3. Copy the key immediately. It is shown only once and cannot be retrieved later.

    In API Keys, you can also verify whether a key is active and see its latest usage timestamp.

    The QuiverAI API uses bearer authentication:

    ```http
    Authorization: Bearer <QUIVERAI_API_KEY>
    ```

    Never commit API keys to source control.

    ![Create new API key](/images/api-key.png)

2. **Store the key in your environment**

    Save the key as `QUIVERAI_API_KEY`.

    <CodeGroup>

    ```bash macOS/Linux
    export QUIVERAI_API_KEY="<your-key>"
    ```

    ```powershell Windows PowerShell
    setx QUIVERAI_API_KEY "<your-key>"
    ```

    </CodeGroup>

3. **Install the SDK**

    For Node.js, use the official [Node.js SDK](https://github.com/quiverai/quiverai-node):

    <CodeGroup>

    ```bash npm
    npm install @quiverai/sdk
    ```

    ```bash yarn
    yarn add @quiverai/sdk
    ```

    ```bash pnpm
    pnpm add @quiverai/sdk
    ```

    </CodeGroup>

4. **Send your first request**

    **Node.js SDK**

    ```typescript
    import { QuiverAI } from "@quiverai/sdk";

    const client = new QuiverAI({
      bearerAuth: process.env["QUIVERAI_API_KEY"],
    });

    const logo = await client.createSVGs.generateSVG({
      model: "arrow-1.1",
      prompt: "A logo for the next AI design startup",
      instructions: "Use clean geometry, balanced spacing, and production-ready SVG structure.",
    });

    process.stdout.write(`${JSON.stringify(logo, null, 2)}\n`);
    ```

    **REST API**

    Use HTTP directly from any language.

    <CodeGroup>

    ```bash cURL
    curl --request POST \
      --url https://api.quiver.ai/v1/svgs/generations \
      --header 'Authorization: Bearer <QUIVERAI_API_KEY>' \
      --header 'Content-Type: application/json' \
      --data '
    {
      "model": "arrow-1.1",
      "prompt": "A logo for the next AI design startup",
      "instructions": "Use clean geometry, balanced spacing, and production-ready SVG structure.",
      "n": 1,
      "stream": false
    }
    '
    ```

    </CodeGroup>

    A successful non-streaming response returns request metadata, one or more SVG payloads, and
    the request credit debit:

    ```json
    {
      "id": "resp_01J9AZ3XJ7D5S9ZV2Q5Z8E1A4N",
      "created": 1704067200,
      "data": [
        {
          "svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M12 2l8 20H4z\"/></svg>",
          "mime_type": "image/svg+xml"
        }
      ],
      "credits": 20
    }
    ```

    The deprecated `usage` token fields may still appear for compatibility, but use `credits`
    and `pricing_credits` for billing behavior.

    Failures return a JSON error payload:

    ```json
    {
      "status": 429,
      "code": "rate_limit_exceeded",
      "message": "Rate limit exceeded",
      "request_id": "550e8400-e29b-41d4-a716-446655440000"
    }
    ```

    - `401 Unauthorized`: API key missing or invalid, or the organization could not be
      resolved for billing. Machine-readable codes include `invalid_api_key` and
      `unauthorized`.
    - `402 Payment Required`: insufficient credits.
    - `403 Forbidden`: frozen accounts use the `account_frozen` code.
    - `429 Too Many Requests`: back off and retry after the number of seconds in
      `Retry-After`. `X-RateLimit-Limit` and `X-RateLimit-Remaining` are counts in the
      current binding window; `X-RateLimit-Reset` is that window's Unix reset timestamp in
      milliseconds. `X-RateLimit-Scope`, `X-RateLimit-Dimension`, and optional
      `X-RateLimit-Subject` name the binding ceiling.

    Billing model:
    - Debits use **pricing credits** in your balance; amounts are **per model** (see each
      model’s `pricing_credits` from `GET /v1/models`).
    - Generations debit **`n × svg_generate`** credits on success (`n` defaults to `1`).
    - Vectorizations debit **`svg_vectorize`** credits per successful request.

To choose from models available to your organization, call `GET /v1/models`. Arrow 1.1 is the
default recommendation for most integrations. Use Arrow 1.1 Max when higher output fidelity is
worth the additional cost and runtime, especially for dense illustrations, technical diagrams, and
other detail-sensitive SVGs.

## Next steps

- Review the [API reference](/api-reference/introduction).
- List available models with `GET /v1/models`.
- See [pricing and plans](/api/pricing).
- Explore models: [Text to SVG](/api/models/text-to-svg) and [Image to SVG](/api/models/image-to-svg).
