---
title: Quickstart
description: Make your first API call to an Avra model, then follow the path from one prediction problem to scores in production.
---

There are two ways to start. If your organization already has models in Avra, start by making your first API call. If you're starting a project, follow the path to production further down: bring one prediction problem and your historical outcomes, and that's enough to start.

## Make your first API call

You need access to [app.avra.ai](https://app.avra.ai) and at least one model available to your organization, with a version behind the `production` alias. The examples call a GFM model, whose input is a company's CNPJ; any model works the same way, with the inputs its schema declares.

1. **Create an API key**

    In the [dashboard](https://app.avra.ai), go to **Settings → Workspace → API keys** and create a key. Keep it in an environment variable, never in code:

    ```bash
    export AVRA_API_KEY="<your key>"
    ```

2. **List your models**

    Every model available to your organization has an `id`, the `model_id` the next steps take, and its `type` tells models apart, such as credit and embedding models.

    ```bash cURL
    curl https://api.avra.ai/v1/api/models \
      -H "Authorization: Bearer $AVRA_API_KEY"
    ```

    ```python Python
    import os

    import requests

    API = "https://api.avra.ai"
    headers = {"Authorization": f"Bearer {os.environ['AVRA_API_KEY']}"}

    response = requests.get(f"{API}/v1/api/models", headers=headers, timeout=30)
    response.raise_for_status()
    print(response.json())
    ```

    ```ts TypeScript
    const API = "https://api.avra.ai";
    const headers = { Authorization: `Bearer ${process.env.AVRA_API_KEY}` };

    const response = await fetch(`${API}/v1/api/models`, { headers });
    if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
    console.log(await response.json());
    ```

3. **Read the version's schema**

    Read the version behind the `production` alias. Its schema lists the `inputs` the model takes and the `outputs` it returns, each with a `name`, a `type`, whether it's `optional`, and an `example`.

    ```bash
    curl https://api.avra.ai/v1/api/models/{model_id}/versions/production \
      -H "Authorization: Bearer $AVRA_API_KEY"
    ```

4. **Call the model**

    Send the inputs the schema declares, with an `X-Correlation-Id` header so the request can be traced later.

    ```bash cURL
    curl -X POST https://api.avra.ai/v1/api/prediction/{model_id}/production \
      -H "Authorization: Bearer $AVRA_API_KEY" \
      -H "Content-Type: application/json" \
      -H "X-Correlation-Id: $(uuidgen)" \
      -d '{"cnpj": "12345678000199"}'
    ```

    ```python Python
    import os
    import uuid

    import requests

    API = "https://api.avra.ai"
    MODEL_ID = "<model_id>"

    response = requests.post(
        f"{API}/v1/api/prediction/{MODEL_ID}/production",
        headers={
            "Authorization": f"Bearer {os.environ['AVRA_API_KEY']}",
            "X-Correlation-Id": str(uuid.uuid4()),
        },
        json={"cnpj": "12345678000199"},
        timeout=30,
    )
    response.raise_for_status()
    print(response.json()["result"])
    ```

    ```ts TypeScript
    const API = "https://api.avra.ai";
    const MODEL_ID = "<model_id>";

    const response = await fetch(`${API}/v1/api/prediction/${MODEL_ID}/production`, {
      method: "POST",
      headers: {
        Authorization: `Bearer ${process.env.AVRA_API_KEY}`,
        "Content-Type": "application/json",
        "X-Correlation-Id": crypto.randomUUID(),
      },
      body: JSON.stringify({ cnpj: "12345678000199" }),
    });
    if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
    console.log((await response.json()).result);
    ```

A successful call returns `200` with `status` set to `completed`, and `result` holds the outputs the version's schema declares:

```json
{
  "operation_id": "...",
  "status": "completed",
  "result": { }
}
```

From here, see [Live predictions](/core/predictions) for limits, errors, and tracing, and [Batch inference](/core/batch-inference) to score many records at once.

## The path to production

1. **Scope the problem**

    Contact Avra at [avra.ai/contact](https://avra.ai/contact). Start with one decision: who you score, the outcome that matters, its horizon, and the system that consumes the answer. Choose where Avra runs: Avra's cloud, or [inside your environment](/deployment).

2. **Get your workspace**

    Avra provisions a tenant-isolated workspace. You get access to [app.avra.ai](https://app.avra.ai), where you invite your team and create API keys.

3. **Bring your data**

    Send the tables you already keep, linked by their keys, with your historical outcomes. Every delivery goes through Avra's [ingestion pipeline](/data-ingestion), which checks it against your data contract before anything is published. A delivery that fails a blocking check is rejected with the reason, instead of failing silently. See [Preparing your data](/data-ingestion/preparing-data).

4. **Frame the prediction and backtest**

    Frame the prediction with your Avra team: the records to score, the outcome, and its window. See [What you can predict](/rfm/what-you-can-predict). [Avra RFM](/rfm) predicts in context from your history, so there's no training project in between. The first result is a backtest on your own data, at past dates whose outcomes are known, compared with the model you run today.

5. **Shadow**

    Run Avra beside your current model on live traffic. Same inputs, two answers, and no effect on the decision until the comparison is settled.

6. **Promote**

    Reassign the `production` alias to the version that earned it, in the dashboard. Rolling back is reassigning it again. See [Model versioning](/core/model-versioning).

Where it pays, a copy of the RFM can also be adapted to your database or fine-tuned on your task. The copy is exclusive to your workspace. See [Adaptation and fine-tuning](/rfm/adaptation).

## Once you're live

**[Live predictions](/core/predictions)**

Score one record at a time through the API

**[Batch inference](/core/batch-inference)**

Score entire portfolios asynchronously

**[Embeddings](/gfm/embeddings)**

Add Avra's embeddings to the models you already run

**[Dashboard](/dashboard)**

Models, batches, alerts, audit, and access in one place

## Where to go from here

**I want to understand the platform first**

Read [Why Avra](/why-avra) and [Models](/models), then the [Avra RFM concepts](/rfm): [relational data](/rfm/relational-data), [what you can predict](/rfm/what-you-can-predict), and [how predictions work](/rfm/predictions). Then [Data ingestion](/data-ingestion) and [Deployment](/deployment).

**I want to see specific use cases**

[Credit](/use-cases/credit-intelligence), [Fraud](/use-cases/fraud-detection), [Acquisition](/use-cases/growth/lead-scoring), or [embeddings](/gfm/embeddings) for the models you already run.

**I'm ready to integrate**

Start with [Live predictions](/core/predictions), then the [API reference](/api-reference) for authentication, endpoints, and integration patterns.
