# API reference

> Every border.bot REST endpoint for HS code classification, landed cost, origin and compliance, with parameters, responses and curl examples.

Source: https://border.bot/docs/api

> Documentation index: https://border.bot/llms.txt. Every page is Markdown at its URL + `.md`.

Base URL `https://api.border.bot`, version 1.3.0. Machine-readable: [OpenAPI 3.1](https://api.border.bot/v1/openapi.json). Try requests in the [interactive reference](https://api.border.bot/v1/docs/interactive).

Classify products to HS/HTS codes and calculate duties, taxes, fees and landed cost for cross-border parcels.

**Versions**: This is **v1**, the current version. Within a version, changes are only additive (new endpoints, new optional fields, new enum values). Breaking changes ship as a new version; every version and its dates: https://api.border.bot/versions

**Authentication**: send a workspace API key: `Authorization: Bearer bb_live_…`. Create keys in the dashboard.

**Credits**: billable requests use prepaid credits (see `GET /v1/pricing`). Prices are set server-side; failed requests are refunded automatically. Every response includes `X-Request-Id` and `API-Version`; billable responses include `X-Credits-Charged` and `X-Credits-Remaining`.

**Retries**: send an `Idempotency-Key` header on POST requests; repeating it returns the original result without charging again.

**Rate limits**: 120 requests per 60 seconds per API key, and per IP address for public endpoints. Responses carry the IETF `RateLimit-Policy` header (`"key";q=120;w=60` with a key, `"ip";q=120;w=60` without). Over the limit you get 429 `rate_limited` with `RateLimit: "key";r=0;t=60` and `Retry-After` in seconds; wait that long before retrying.

**Errors**: `{ "error": { "code", "message", "details"? } }` with a stable `code` (e.g. 402 `insufficient_credits`, 429 `rate_limited`).

**MCP**: use border.bot from Claude, ChatGPT, Codex, Cursor, VS Code and other MCP clients at `https://api.border.bot/mcp` (OAuth, no API key). Setup guides: https://border.bot/mcp

## Classification

HS/HTS codes.

- [Classify a product](https://border.bot/docs/api/classify-product): `POST /v1/classify`
- [Classify up to 25 products](https://border.bot/docs/api/classify-batch): `POST /v1/classify/batch`
- [Find an agency product code](https://border.bot/docs/api/classify-regulator): `POST /v1/classify/regulator`
- [Classification modes](https://border.bot/docs/api/classify-modes): `GET /v1/classify/modes`
- [Blocked codes](https://border.bot/docs/api/list-blocked-codes): `GET /v1/classify/blocklist`
- [Block a code](https://border.bot/docs/api/add-blocked-code): `POST /v1/classify/blocklist`
- [Unblock a code](https://border.bot/docs/api/remove-blocked-code): `DELETE /v1/classify/blocklist`
- [Block many codes](https://border.bot/docs/api/import-blocked-codes): `POST /v1/classify/blocklist/import`
- [Say whether a classification was right](https://border.bot/docs/api/send-classify-feedback): `POST /v1/classify/feedback`

## Landed cost

Duties, taxes and fees.

- [Calculate duties, taxes and landed cost](https://border.bot/docs/api/calculate-landed-cost): `POST /v1/calculate`
- [Calculate a whole shipment](https://border.bot/docs/api/calculate-shipment): `POST /v1/calculate/shipment`
- [Duty stacking](https://border.bot/docs/api/duty-stacking): `POST /v1/calculate/stacking`

## Products

Product pages and country of origin.

- [Read a product page](https://border.bot/docs/api/extract-product): `POST /v1/products/extract`

## Compliance

Restricted and prohibited goods (free).

- [Check restricted goods](https://border.bot/docs/api/check-restricted-goods): `POST /v1/restrictions`
- [Restricted-goods checks](https://border.bot/docs/api/list-restriction-checks): `GET /v1/restrictions/checks`
- [Your restricted-goods rules](https://border.bot/docs/api/list-restriction-rules): `GET /v1/restrictions/rules`
- [Add a restricted-goods rule](https://border.bot/docs/api/add-restriction-rule): `POST /v1/restrictions/rules`
- [Remove a restricted-goods rule](https://border.bot/docs/api/remove-restriction-rule): `DELETE /v1/restrictions/rules`
- [Screen a person or company](https://border.bot/docs/api/screen-party): `POST /v1/screen`
- [Your screening checks](https://border.bot/docs/api/list-screening-checks): `GET /v1/screen/checks`

## Account

Your workspace, credits and usage.

- [Who am I](https://border.bot/docs/api/get-workspace): `GET /v1/me`
- [Credit balance](https://border.bot/docs/api/get-credits): `GET /v1/credits`
- [Usage history](https://border.bot/docs/api/list-usage): `GET /v1/usage`
- [Request log](https://border.bot/docs/api/list-api-requests): `GET /v1/requests`

## Reference

Public reference data (no key needed).

- [Supported countries](https://border.bot/docs/api/list-countries): `GET /v1/countries`
- [Pricing](https://border.bot/docs/api/get-pricing): `GET /v1/pricing`

## Origin

- [Infer country of origin](https://border.bot/docs/api/infer-origin): `POST /v1/origin`
- [Check a declared country of origin](https://border.bot/docs/api/validate-origin): `POST /v1/origin/validate`
- [Infer or check the origin of up to 50 products](https://border.bot/docs/api/origin-batch): `POST /v1/origin/batch`

## Bulk

- [Your bulk runs](https://border.bot/docs/api/list-bulk-runs): `GET /v1/bulk/runs`
- [Start a bulk run](https://border.bot/docs/api/start-bulk-run): `POST /v1/bulk/runs`
- [Cancel a bulk run](https://border.bot/docs/api/cancel-bulk-run): `DELETE /v1/bulk/runs`
- [A bulk run’s progress](https://border.bot/docs/api/bulk-run-status): `GET /v1/bulk/status`
- [A bulk run’s results](https://border.bot/docs/api/bulk-results): `GET /v1/bulk/results`
