---
title: "Calcula Frete ANTT"
description: "API Frete - Cálculo Fácil e Confiável para Transportes"
lang: en
canonical: https://doc.apibrasil.io/apis/creditos/da05ccf3-0d65-43bd-9c37-d402f61d61ed
markdown: https://doc.apibrasil.io/apis/creditos/da05ccf3-0d65-43bd-9c37-d402f61d61ed.md
source: apibrasil-documentation
---

# Calcula Frete ANTT

> API Frete - Cálculo Fácil e Confiável para Transportes

- **Category:** Digital Services
- **Billing:** per query, with the Bearer Token only
- **Price:** R$0.05 per query
- **Limit:** 999,000 per month
- **Registration:** requires a CNPJ
- **Version:** v2
- **Published by:** APIBrasil
- **OpenAPI specification:** https://doc.apibrasil.io/apis/creditos/da05ccf3-0d65-43bd-9c37-d402f61d61ed/openapi.json

## How to call

**Base address:** `https://gateway.apibrasil.io/api/v2`

Authentication: the `Authorization: Bearer <token>` header. Nothing else.

With `homolog: true` in the body, the gateway answers from a fixed base, with the real shape of the response, and does not charge. The CPF 00000000000 belongs to that base and to nobody: use it in tests, never in production.

## Endpoints (6 endpoints)

**Contents**

1. `POST /consulta/frete-antt/credits`
2. `POST /consulta/frete-antt/credits`
3. `POST /consulta/frete-antt/credits`
4. `POST /consulta/frete-antt/credits`
5. `POST /consulta/frete-antt/credits`
6. `POST /consulta/frete-antt/credits`

### 1. POST /consulta/frete-antt/credits

API de Frete ANTT - Calcule Seu Frete Rápido e Com Precisão

A API Calcula Frete ANTT permite que sua empresa integre rapidamente o cálculo de fretes conforme a tabela oficial da ANTT, trazendo praticidade e total aderência à legislação para seus processos logísticos. Com uma simples chamada POST ao endpoint consulta/frete-antt/credits, você recebe em tempo real o valor detalhado do frete, otimizando a tomada de decisão e agregando valor imediato ao seu sistema de gestão. Ideal para transportadoras, embarcadores e plataformas ERP, essa API facilita a automatização de cotações e contratos, garantindo segurança e transparência nos custos. Potencialize resultados e proporcione uma experiência inovadora aos seus usuários, confiando no cálculo sempre atualizado diretamente em sua operação.

- **Method:** `POST`
- **Address:** `https://gateway.apibrasil.io/api/v2/consulta/frete-antt/credits`
- **Route version:** v2

**Headers**

| Header | Value |
| --- | --- |
| `Content-Type` | `application/json` |
| `Authorization` | `Bearer $APIBRASIL_TOKEN` |

**Request body**

```json
{
  "tipo": "calcula-frete",
  "homolog": true,
  "tipoCarga": "carga_geral",
  "eixos": 6,
  "distanciaKm": 100,
  "composicaoVeicular": "cavalo_trucado",
  "altoDesempenho": false,
  "retornoVazio": false,
  "dataReferencia": "2026-03-20"
}
```

**In cURL**

```bash
curl -X POST "https://gateway.apibrasil.io/api/v2/consulta/frete-antt/credits" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $APIBRASIL_TOKEN" \
  -d '{"tipo":"calcula-frete","homolog":true,"tipoCarga":"carga_geral","eixos":6,"distanciaKm":100,"composicaoVeicular":"cavalo_trucado","altoDesempenho":false,"retornoVazio":false,"dataReferencia":"2026-03-20"}'
```

This endpoint accepts `homolog: true` in the body: the response comes back with valid data, `api_limit_for` equal to `homolog` and no charge.

**Sample response, from the catalog**

```json
{
  "user": {
    "first_name": "[omitido]",
    "email": "[omitido]",
    "cellphone": "[omitido]",
    "notification": "yes"
  },
  "balance": "1.044,110",
  "error": false,
  "message": "Dados validos em homologacao! Voce nao foi tarifado e a requisicao nao foi contabilizada.",
  "tax": "0,000",
  "valor_consulta": 0,
  "api_limit_for": "homolog",
  "homolog": true,
  "data": {
    "pisoMinimo": {
      "bruto": 777.77,
      "formatado": "R$ 777,77",
      "moeda": "BRL"
    },
    "ccdAplicado": {
      "bruto": 3.1415,
      "formatado": "3,1415",
      "unidade": "R$/km"
    },
    "ccAplicado": {
      "bruto": 120.5,
      "formatado": "R$ 120,50",
      "moeda": "BRL"
    },
    "versaoNormativa": "9.999/2099",
    "documentoBase": "9.999/2099",
    "vigenciaInicio": "2099-01-01",
    "vigenciaFim": null
  }
}
```

### 2. POST /consulta/frete-antt/credits

API Frete ANTT - Calcule o preço ideal do transporte em segundos

Com a Calcula Frete ANTT, sua empresa obtém o valor exato do frete rodoviário de acordo com a tabela ANTT em poucos cliques, por meio de uma integração rápida e segura. Através deste endpoint, você recebe instantaneamente dados precisos para simular opções de custo de transporte e garantir o cumprimento da legislação, maximizando a rentabilidade de suas operações. Este endpoint (tipo opcoes-calculo) lista as opções de cálculo disponíveis na data de referência; o valor do frete é calculado no tipo calcula-frete, possibilitando a automatização dos orçamentos em plataformas de gestão, ERPs ou sistemas logísticos, agilizando processos e evitando custos indevidos. Simplifique agora o cálculo do frete, gere confiança para seus clientes e mantenha-se competitivo no mercado.

- **Method:** `POST`
- **Address:** `https://gateway.apibrasil.io/api/v2/consulta/frete-antt/credits`
- **Route version:** v2

**Headers**

| Header | Value |
| --- | --- |
| `Content-Type` | `application/json` |
| `Authorization` | `Bearer $APIBRASIL_TOKEN` |

**Request body**

```json
{
  "tipo": "opcoes-calculo",
  "homolog": true,
  "dataReferencia": "2026-03-20"
}
```

**In cURL**

```bash
curl -X POST "https://gateway.apibrasil.io/api/v2/consulta/frete-antt/credits" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $APIBRASIL_TOKEN" \
  -d '{"tipo":"opcoes-calculo","homolog":true,"dataReferencia":"2026-03-20"}'
```

This endpoint accepts `homolog: true` in the body: the response comes back with valid data, `api_limit_for` equal to `homolog` and no charge.

**Sample response, from the catalog**

```json
{
  "user": {
    "first_name": "[omitido]",
    "email": "[omitido]",
    "cellphone": "[omitido]",
    "notification": "yes"
  },
  "balance": "1.044,110",
  "error": false,
  "message": "Dados validos em homologacao! Voce nao foi tarifado e a requisicao nao foi contabilizada.",
  "tax": "0,000",
  "valor_consulta": 0,
  "api_limit_for": "homolog",
  "homolog": true,
  "data": {
    "versaoNormativa": "9.999/2099",
    "vigenciaInicio": "2099-01-01",
    "vigenciaFim": null,
    "tipoCarga": [
      "carga_demo_palete",
      "granel_demo_controlado"
    ],
    "eixos": [
      4,
      6,
      9
    ],
    "composicaoVeicular": [
      "bitrem_demo",
      "truck_demo"
    ],
    "altoDesempenho": [
      false,
      true
    ],
    "retornoVazio": [
      false,
      true
    ]
  }
}
```

### 3. POST /consulta/frete-antt/credits

API Frete e Carga - Calcule fretes ANTT com praticidade e precisão

Otimize o cálculo do frete regulado com a API Calcula Frete ANTT, ideal para transportadoras, marketplaces, TMS e plataformas logísticas que buscam agilidade e conformidade. Com integração rápida via POST, você consulta os modelos de carga aceitos pela tabela ANTT na data de referência (tipo modelos-carga). O serviço retorna valores completos de acordo com as regras atualizadas, permitindo uma precificação precisa, transparência nas operações e integração direta ao seu sistema. Potencialize decisões comerciais e garanta competitividade com cálculos automáticos, prontos para escala e homologados para uso no seu negócio.

- **Method:** `POST`
- **Address:** `https://gateway.apibrasil.io/api/v2/consulta/frete-antt/credits`
- **Route version:** v2

**Headers**

| Header | Value |
| --- | --- |
| `Content-Type` | `application/json` |
| `Authorization` | `Bearer $APIBRASIL_TOKEN` |

**Request body**

```json
{
  "tipo": "modelos-carga",
  "homolog": true,
  "dataReferencia": "2026-03-20"
}
```

**In cURL**

```bash
curl -X POST "https://gateway.apibrasil.io/api/v2/consulta/frete-antt/credits" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $APIBRASIL_TOKEN" \
  -d '{"tipo":"modelos-carga","homolog":true,"dataReferencia":"2026-03-20"}'
```

This endpoint accepts `homolog: true` in the body: the response comes back with valid data, `api_limit_for` equal to `homolog` and no charge.

**Sample response, from the catalog**

```json
{
  "user": {
    "first_name": "[omitido]",
    "email": "[omitido]",
    "cellphone": "[omitido]",
    "notification": "yes"
  },
  "balance": "1.044,110",
  "error": false,
  "message": "Dados validos em homologacao! Voce nao foi tarifado e a requisicao nao foi contabilizada.",
  "tax": "0,000",
  "valor_consulta": 0,
  "api_limit_for": "homolog",
  "homolog": true,
  "data": {
    "versaoNormativa": "9.999/2099",
    "vigenciaInicio": "2099-01-01",
    "vigenciaFim": null,
    "tipoCarga": [
      "carga_demo_palete",
      "granel_demo_controlado"
    ],
    "catalogoOficial": [
      {
        "id": 901,
        "nome": "Carga Demo Paletizada",
        "chave": "carga_demo_palete"
      },
      {
        "id": 902,
        "nome": "Granel Demo Controlado",
        "chave": "granel_demo_controlado"
      },
      {
        "id": 903,
        "nome": "Conteiner Demo Lacrado",
        "chave": "conteiner_demo_lacrado"
      }
    ]
  }
}
```

### 4. POST /consulta/frete-antt/credits

API Frete ANTT - Calcule o frete oficial em segundos

Com a API Calcula Frete ANTT, você integra rapidamente o cálculo oficial do frete rodoviário conforme a normativa vigente, garantindo total conformidade e agilidade nas suas operações logísticas. Realize consultas rápidas via POST e obtenha a normativa da ANTT vigente na data de referência (tipo normativa-atual). A solução se adapta facilmente ao seu sistema, otimizando simulações comerciais, geração automática de orçamentos ou atualização de propostas junto aos seus clientes, tudo com segurança e confiabilidade. Potencialize seu negócio com cálculos atualizados e alta performance.

- **Method:** `POST`
- **Address:** `https://gateway.apibrasil.io/api/v2/consulta/frete-antt/credits`
- **Route version:** v2

**Headers**

| Header | Value |
| --- | --- |
| `Content-Type` | `application/json` |
| `Authorization` | `Bearer $APIBRASIL_TOKEN` |

**Request body**

```json
{
  "tipo": "normativa-atual",
  "homolog": true,
  "dataReferencia": "2026-03-20"
}
```

**In cURL**

```bash
curl -X POST "https://gateway.apibrasil.io/api/v2/consulta/frete-antt/credits" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $APIBRASIL_TOKEN" \
  -d '{"tipo":"normativa-atual","homolog":true,"dataReferencia":"2026-03-20"}'
```

This endpoint accepts `homolog: true` in the body: the response comes back with valid data, `api_limit_for` equal to `homolog` and no charge.

**Sample response, from the catalog**

```json
{
  "user": {
    "first_name": "[omitido]",
    "email": "[omitido]",
    "cellphone": "[omitido]",
    "notification": "yes"
  },
  "balance": "1.044,110",
  "error": false,
  "message": "Dados validos em homologacao! Voce nao foi tarifado e a requisicao nao foi contabilizada.",
  "tax": "0,000",
  "valor_consulta": 0,
  "api_limit_for": "homolog",
  "homolog": true,
  "data": {
    "id": "mock-version-001",
    "versionLabel": "9.999/2099",
    "validFrom": "2099-01-01T00:00:00.000Z",
    "validTo": null,
    "reason": "Versao ficticia para homologacao",
    "document": "9.999/2099"
  }
}
```

### 5. POST /consulta/frete-antt/credits

API de Frete ANTT - Calcule Fretes Oficiais com Facilidade

A API Calcula Frete ANTT lista, neste endpoint (tipo versoes-normativas), as versões da normativa da ANTT usadas no cálculo do frete rodoviário de cargas, garantindo total conformidade com as normas vigentes. Com integração rápida via POST e resposta instantânea incluindo todos os detalhes exigidos pela legislação, seu sistema pode agregar o cálculo oficial de frete a cada orçamento, cotação, emissão de conhecimento de transporte ou qualquer processo logístico de sua operação. Aumente a eficiência operacional, reduza riscos fiscais e entregue valor ao cliente integrando em poucos minutos uma solução homologada, pronta para uso e sempre atualizada conforme as versões normativas da ANTT.

- **Method:** `POST`
- **Address:** `https://gateway.apibrasil.io/api/v2/consulta/frete-antt/credits`
- **Route version:** v2

**Headers**

| Header | Value |
| --- | --- |
| `Content-Type` | `application/json` |
| `Authorization` | `Bearer $APIBRASIL_TOKEN` |

**Request body**

```json
{
  "tipo": "versoes-normativas",
  "homolog": true
}
```

**In cURL**

```bash
curl -X POST "https://gateway.apibrasil.io/api/v2/consulta/frete-antt/credits" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $APIBRASIL_TOKEN" \
  -d '{"tipo":"versoes-normativas","homolog":true}'
```

This endpoint accepts `homolog: true` in the body: the response comes back with valid data, `api_limit_for` equal to `homolog` and no charge.

**Sample response, from the catalog**

```json
{
  "user": {
    "first_name": "[omitido]",
    "email": "[omitido]",
    "cellphone": "[omitido]",
    "notification": "yes"
  },
  "balance": "1.044,110",
  "error": false,
  "message": "Dados validos em homologacao! Voce nao foi tarifado e a requisicao nao foi contabilizada.",
  "tax": "0,000",
  "valor_consulta": 0,
  "api_limit_for": "homolog",
  "homolog": true,
  "data": {
    "items": [
      {
        "id": "mock-version-001",
        "versionLabel": "9.999/2099",
        "validFrom": "2099-01-01T00:00:00.000Z",
        "validTo": null,
        "reason": "Versao ficticia para homologacao",
        "baseDocumentId": "mock-doc-001"
      },
      {
        "id": "mock-version-000",
        "versionLabel": "9.998/2098",
        "validFrom": "2098-12-01T00:00:00.000Z",
        "validTo": "2098-12-31T00:00:00.000Z",
        "reason": "Historico ficticio",
        "baseDocumentId": "mock-doc-000"
      }
    ]
  }
}
```

### 6. POST /consulta/frete-antt/credits

API de Frete ANTT - Otimize o cálculo de fretes em segundos

A API Calcula Frete ANTT fornece cálculos precisos e atualizados conforme as normativas da ANTT, permitindo que seu sistema automatize orçamentos de transporte com máxima confiabilidade e agilidade. Com integração rápida via POST, o serviço retorna informações detalhadas de crédito e valores normativos prontos para uso imediato em suas operações, reduzindo erros e acelerando decisões comerciais. Ganhe vantagem competitiva integrando esse recurso ao seu fluxo, atendendo as exigências do setor de transporte e garantindo transparência e economia para seus clientes.

- **Method:** `POST`
- **Address:** `https://gateway.apibrasil.io/api/v2/consulta/frete-antt/credits`
- **Route version:** v2

**Headers**

| Header | Value |
| --- | --- |
| `Content-Type` | `application/json` |
| `Authorization` | `Bearer $APIBRASIL_TOKEN` |

**Request body**

```json
{
  "tipo": "sincroniza-normativas",
  "homolog": true
}
```

**In cURL**

```bash
curl -X POST "https://gateway.apibrasil.io/api/v2/consulta/frete-antt/credits" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $APIBRASIL_TOKEN" \
  -d '{"tipo":"sincroniza-normativas","homolog":true}'
```

This endpoint accepts `homolog: true` in the body: the response comes back with valid data, `api_limit_for` equal to `homolog` and no charge.

**Sample response, from the catalog**

```json
{
  "user": {
    "first_name": "[omitido]",
    "email": "[omitido]",
    "cellphone": "[omitido]",
    "notification": "yes"
  },
  "balance": "1.044,110",
  "error": false,
  "message": "Dados validos em homologacao! Voce nao foi tarifado e a requisicao nao foi contabilizada.",
  "tax": "0,000",
  "valor_consulta": 0,
  "api_limit_for": "homolog",
  "homolog": true,
  "data": {
    "synced": true,
    "versionId": "mock-version-001",
    "coefficientCount": 24,
    "references": {
      "normativeBase": {
        "reference": "9.999/2099",
        "date": "2099-01-01",
        "url": "https://homolog.exemplo.local/normative-base",
        "title": "Resolucao ficticia de homologacao",
        "fetchedAt": "2099-01-15T10:00:00.000Z"
      },
      "updates": {
        "reference": "Atualizacao ficticia de homologacao",
        "date": "2099-01-15",
        "url": "https://homolog.exemplo.local/updates",
        "title": "Atualizacao simulada",
        "fetchedAt": "2099-01-15T10:05:00.000Z"
      }
    }
  }
}
```

In the sample responses, the fields of the account that generated the sample (`user.first_name`, `user.email`, `user.cellphone`) come out as `[omitido]`. The rest is what the catalog publishes.

## Pitfalls: what an integration gets wrong without warning

Established from the responses the catalog itself publishes. In every one of them the code works on the happy path and fails silently everywhere else:

1. **The error arrives in the BODY, with HTTP 200.**
   The response carries a boolean `error` field and a `message`. Checking only `response.ok` or the HTTP status lets a failure through as a success. ALWAYS check `error === false` before reading `data`.

2. **`balance`, `tax` and `extra_charges.total` are STRINGS in Brazilian format — and the format varies between APIs.**
   Values seen in the catalog: `"154,380"`, `"497,84"`, `"0,000"` and `"0.19"`. Comma in some, dot in another; three decimal places in some, two in another. In JavaScript, `parseFloat("154,380")` returns `154` and drops the cents with no error at all, and `Number("154,380")` returns `NaN`. Write a converter that handles both separators, and never use these fields in a financial decision without converting them.

3. **Every call costs money.**
   Blind retries multiply the bill. Never automatically repeat a 4xx: a bad parameter repeated is still bad, and still charged. Retry only timeouts and 5xx, with exponential backoff and a small attempt ceiling.

4. **HTTP 402 means insufficient balance, and retrying does not fix it.**
   It is the one status that needs a human — a top-up. Treat it as a terminal error with its own message, and do not lump it in with generic 4xx.

5. **`extra_charges` bills on top of the lookup price.**
   When the body asks for add-on services, the response lists each one with its price plus a `total` that is NOT included in the base amount. If you show cost to an end user, add both.

## See also

- OpenAPI specification: https://doc.apibrasil.io/apis/creditos/da05ccf3-0d65-43bd-9c37-d402f61d61ed/openapi.json
- API catalog: [API catalog](https://doc.apibrasil.io/apis.md)
- Official SDKs: [Official SDKs](https://doc.apibrasil.io/sdks.md)
- Documentation index: https://doc.apibrasil.io/llms.txt
- HTML version of this page: https://doc.apibrasil.io/apis/creditos/da05ccf3-0d65-43bd-9c37-d402f61d61ed
