# Quote a model file

For integrators.

Uploads a model file, creates a quote and waits for the price. Slicing is automatic and usually takes seconds to a few minutes. Before your account is approved, quotes are limited per round and per day; `get_integrator_onboarding` shows the allowance.

## What you need

-   `file_name` (string, required): Name of the model file, for example `bracket.stl`.
-   `content_type` (string, required): MIME type of the file, for example `model/stl`, `model/3mf` or `model/step`.
-   `size_bytes` (integer, required): Size of the file in bytes, up to 250 MiB.
-   `name` (string): A name for the quote; defaults to the file name.

## Step 1: Start a file upload

[POST `/v2/uploads`](https://public-api.dapi.digital/docs/reference/uploads.md#create_upload)

Reserve an upload for the model file. Then send the file bytes to `upload_url` with the returned `method` and `headers`. That transfer goes straight to storage, not to this API, so it is not a step here; do it before the next step.

**Request body**

```json
{
  "purpose": "quote_file",
  "file_name": "$inputs.file_name",
  "content_type": "$inputs.content_type",
  "size_bytes": "$inputs.size_bytes"
}
```

Succeeds when:

-   `$statusCode == 201`

Keeps for the next steps:

-   `upload_id`: `$response.body#/id`

## Step 2: Quote a model file

[POST `/v2/quotes`](https://public-api.dapi.digital/docs/reference/quotes.md#create_quote)

Start pricing. `upload_limit_reached` (409) means this round is used up: request approval next. `approval_in_review` (409) means quoting resumes after the review. `daily_quote_limit_reached` (429) resets at midnight UTC.

**Request body**

```json
{
  "file": {
    "upload": "$steps.upload_model.outputs.upload_id"
  },
  "name": "$inputs.name"
}
```

Succeeds when:

-   `$statusCode == 201`

Otherwise:

-   `quota_or_review`: stop the workflow when `$statusCode == 409`.
-   `daily_quote_limit_reached`: stop the workflow when `$statusCode == 429`.

Keeps for the next steps:

-   `quote_id`: `$response.body#/id`

## Step 3: Get a quote

[GET `/v2/quotes/{id}`](https://public-api.dapi.digital/docs/reference/quotes.md#get_quote)

Poll the quote every few seconds until `status` is `ready` (it has a `price`) or `failed` (`failure_reason` says why; a failed quote is given back to your allowance).

**Parameters**

```json
{
  "path id": "$steps.create_quote.outputs.quote_id"
}
```

Succeeds when:

-   `$statusCode == 200`
-   `$response.body#/status == 'ready'`

Otherwise:

-   `still_processing`: retry after 5 seconds, at most 120 times, when `$response.body#/status == 'processing'`.
-   `quote_failed`: stop the workflow when `$response.body#/status == 'failed'`.

Keeps for the next steps:

-   `status`: `$response.body#/status`
-   `price`: `$response.body#/price`
-   `failure_reason`: `$response.body#/failure_reason`

## As a workflow file

The workflow returns:

-   `quote_id`: `$steps.create_quote.outputs.quote_id`
-   `price`: `$steps.wait_for_price.outputs.price`

Values starting with `$` are filled in as you go: `$inputs.x` is something you provide, `$steps.s.outputs.o` is a value an earlier step returned, and `$response.body#/path` a field of this response.

This recipe is the workflow `quote_model_file` of [arazzo.json](https://public-api.dapi.digital/docs/arazzo.json), an [Arazzo 1.0](https://spec.openapis.org/arazzo/latest.html) document that tools and AI agents can follow step by step.

---

3DAPI API Docs. This page on the web: https://public-api.dapi.digital/docs/guides/quote-model-file. Index of every page: https://public-api.dapi.digital/docs/llms.txt.
