> ## Documentation Index
> Fetch the complete documentation index at: https://aisa.one/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> - Base URLs: models `https://api.aisa.one/v1` (Gemini GenerateContent: `https://api.aisa.one/v1beta`); data APIs `https://api.aisa.one/apis/v1`. The `servers` of each operation in https://aisa.one/openapi.yaml is authoritative.
> - Auth: `Authorization: Bearer $AISA_API_KEY`. Never print, log, or commit the key.
> - MCP (preferred for agents): `https://mcp.aisa.one/mcp`, signed in with OAuth, so there is no key to paste.
> - Agent Skill: `npx skills add AIsa-team/agent-skills --skill aisa`. Fallback with the AIsa CLI: `aisa skills install aisa`.
> - Spending: docs, https://aisa.one/models, https://aisa.one/api, `/v1/models`, and MCP `search`, `list_categories`, `get_details`, `batch_quote`, and the `account` operation are free. Quote the exact calls before running them (MCP `batch_quote`, CLI `aisa quote --json`). If the quote reports `auto_execute_eligible: true`, run it unless the user set a tighter limit or asked only for a quote. Otherwise, tell the user in one message the planned calls, the quoted price, and a total USD budget for the task, then wait for approval. Direct HTTP calls follow the stricter rule at https://aisa.one/docs/get-started/cli.md#direct-http-fallback. Do not make paid calls to test availability. Full rule: https://aisa.one/llms.txt

# Reference codes

> Resolve a country or product name to the numeric/HS code the other functions need (China -> 156, 'static converters' -> 850440), or list the valid flow, customs or transport codes.

## Request contract

* **Method and path:** POST /apis/v1/comtradeplus-un-org/trade-statistics/reference-codes
* **Availability:** enabled
* **Request URL template:** `https://api.aisa.one/apis/v1/comtradeplus-un-org/trade-statistics/reference-codes`

[Complete OpenAPI definition](https://aisa.one/docs/openapi/comtradeplus-un-org.json)

Effective request declaration (including authentication and referenced schemas):

```json theme={null}
{
  "operationId": "comtradeplus-un-org.trade-statistics.reference-codes",
  "method": "POST",
  "path": "/apis/v1/comtradeplus-un-org/trade-statistics/reference-codes",
  "servers": [
    {
      "url": "https://api.aisa.one"
    }
  ],
  "parameters": [],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "examples": {
          "provider": {
            "summary": "Official provider example; checked against AIsa request constraints",
            "value": {
              "query": "China",
              "table": "Reporters"
            }
          }
        },
        "schema": {
          "additionalProperties": true,
          "properties": {
            "limit": {
              "default": 200,
              "description": "Maximum rows returned after filtering (HS has 8262 rows).\n\nProvider reference: minimum 1; maximum 2000; default 200.",
              "type": "number",
              "x-alexandria-option-metadata": {
                "in": "body",
                "max": 2000,
                "min": 1
              }
            },
            "query": {
              "description": "Keep rows whose id or text contains this (case-insensitive).",
              "type": "string",
              "x-alexandria-option-metadata": {
                "in": "body"
              }
            },
            "table": {
              "description": "Table name as listed above (case-sensitive, as the file is named). Pattern: ^[A-Za-z0-9]{1,32}$.",
              "type": "string"
            }
          },
          "required": [
            "table"
          ],
          "type": "object"
        }
      }
    },
    "required": true
  },
  "x-aisa-status": "enabled",
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  }
}
```

## Cost and request rules

Usage-based pricing. Default request estimate: \$0.0005 USD. The final charge depends on actual usage. Your account price may differ; use a request quote where supported.


## OpenAPI

````yaml openapi/comtradeplus-un-org.json POST /apis/v1/comtradeplus-un-org/trade-statistics/reference-codes
openapi: 3.1.0
info:
  description: ''
  title: UN Comtrade (comtradeplus.un.org)
  version: '1'
  x-aisa-capabilities:
    idempotency: Idempotency-Key
    max_price: X-AISA-Max-Price-USD
    quote:
      header: X-AISA-Cost-Mode
      value: quote
  x-aisa-catalogs:
    comtradeplus-un-org:
      description: ''
      title: UN Comtrade (comtradeplus.un.org)
      x-aisa-capabilities:
        idempotency: Idempotency-Key
        max_price: X-AISA-Max-Price-USD
        quote:
          header: X-AISA-Cost-Mode
          value: quote
      x-aisa-document:
        facts_hash: e3ef36bfa048f007a414dd876a78e26bb544fcd89067d4e79db632b2316176c1
        generator_version: '3'
        protocol_version: '1'
        schema_version: '1'
      x-aisa-plans:
        builder: 1
        display_plan: payg
        payg: 1
        similarweb_payg: 1
        team: 1
        version: e70a0959cd1b93b84ae16dffd7a538273ddb9c1d46277b82823c37ff1b6bc0fb
  x-aisa-configured-paths:
    - /apis/v1/comtradeplus-un-org/trade-statistics/data-availability
    - /apis/v1/comtradeplus-un-org/trade-statistics/dataset-metadata
    - /apis/v1/comtradeplus-un-org/trade-statistics/mbs-series
    - /apis/v1/comtradeplus-un-org/trade-statistics/recent-releases
    - /apis/v1/comtradeplus-un-org/trade-statistics/reference-codes
    - /apis/v1/comtradeplus-un-org/trade-statistics/tariffline-data
    - /apis/v1/comtradeplus-un-org/trade-statistics/trade-data
    - /apis/v1/comtradeplus-un-org/trade-statistics/world-share
  x-aisa-document:
    composer_version: '31'
    document_hash: sha256:61d97ae3b5b006713a2f879e337298ca98fef5bc3c20e018a8778f9b6ea4616f
    facts_hash: e3ef36bfa048f007a414dd876a78e26bb544fcd89067d4e79db632b2316176c1
    generator_version: '3'
    protocol_version: '1'
    response_pending: []
    schema_version: '1'
  x-aisa-plans:
    builder: 1
    display_plan: payg
    payg: 1
    similarweb_payg: 1
    team: 1
    version: e70a0959cd1b93b84ae16dffd7a538273ddb9c1d46277b82823c37ff1b6bc0fb
  x-aisa-provider: comtradeplus-un-org
servers:
  - url: https://api.aisa.one
security:
  - bearerAuth: []
paths:
  /apis/v1/comtradeplus-un-org/trade-statistics/reference-codes:
    post:
      tags:
        - UN Comtrade (comtradeplus.un.org)
      summary: Reference codes
      description: >-
        Resolve a country or product name to the numeric/HS code the other
        functions need (China -> 156, 'static converters' -> 850440), or list
        the valid flow, customs or transport codes.
      operationId: comtradeplus-un-org.trade-statistics.reference-codes
      requestBody:
        content:
          application/json:
            examples:
              provider:
                summary: >-
                  Official provider example; checked against AIsa request
                  constraints
                value:
                  query: China
                  table: Reporters
            schema:
              additionalProperties: true
              properties:
                limit:
                  default: 200
                  description: |-
                    Maximum rows returned after filtering (HS has 8262 rows).

                    Provider reference: minimum 1; maximum 2000; default 200.
                  type: number
                  x-alexandria-option-metadata:
                    in: body
                    max: 2000
                    min: 1
                query:
                  description: Keep rows whose id or text contains this (case-insensitive).
                  type: string
                  x-alexandria-option-metadata:
                    in: body
                table:
                  description: >-
                    Table name as listed above (case-sensitive, as the file is
                    named). Pattern: ^[A-Za-z0-9]{1,32}$.
                  type: string
              required:
                - table
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              examples:
                provider:
                  description: Published by the provider on 2026-10-19.
                  summary: Official provider example
                  value:
                    codes:
                      - entryEffectiveDate: '1900-01-01T00:00:00'
                        id: '156'
                        isGroup: false
                        reporterCode: 156
                        reporterCodeIsoAlpha2: CN
                        reporterCodeIsoAlpha3: CHN
                        reporterDesc: China
                        reporterNote: China
                        text: China
                      - entryEffectiveDate: '1900-01-01T00:00:00'
                        id: '344'
                        isGroup: false
                        reporterCode: 344
                        reporterCodeIsoAlpha2: HK
                        reporterCodeIsoAlpha3: HKG
                        reporterDesc: China, Hong Kong SAR
                        reporterNote: China, Hong Kong Special Administrative Region
                        text: China, Hong Kong SAR
                      - entryEffectiveDate: '1900-01-01T00:00:00'
                        id: '446'
                        isGroup: false
                        reporterCode: 446
                        reporterCodeIsoAlpha2: MO
                        reporterCodeIsoAlpha3: MAC
                        reporterDesc: China, Macao SAR
                        reporterNote: China, Macao Special Administrative Region
                        text: China, Macao SAR
                    count: 3
                    matched: 3
                    observed_at_ms: 1792433743469
                    query: China
                    source_url: >-
                      https://comtradeapi.un.org/files/v1/app/reference/Reporters.json
                    table: Reporters
                    total: 255
              schema:
                not:
                  type: 'null'
                x-aisa-schema-completeness: documented-fields-only
          description: >-
            A UN Comtrade reference code table (GET
            /files/v1/app/reference/{table}.json): Reporters, partnerAreas, HS
            (all editions combined), H0-H6, S1-S4, SS, B4, B5, EB, EB02, EB10,
            EB10S, tradeRegimes (flows), ModeOfTransportCodes, CustomsCodes,
            QuantityUnits, ModeOfSupply, Frequency, TradeDataItems. Optional
            case-insensitive substring filter on code and text; rows pass
            through with the table's own columns. An unknown table name is
            not_found.


            The response contains the tool result directly.


            | Documented field | Provider type | Description |

            | --- | --- | --- |

            | `codes` | object[] |  |

            | `count` | number | Rows returned. |

            | `matched` | number | Rows matching the query before `limit`. |

            | `observed_at_ms` | number | Unix milliseconds when this result was
            fetched. |

            | `query` | string |  |

            | `source_url` | string | The comtradeapi.un.org request that
            produced this result. |

            | `table` | string | As requested. |

            | `total` | number | Rows in the table. |



            These are the provider's documented fields. Field requiredness,
            nullability and nested object structures are specified only where
            the descriptions explicitly say so.
        default:
          content:
            application/json:
              schema: {}
          description: >-
            Error response; upstream passthrough responses may use provider
            formats
components:
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.