> ## 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

# Malha

> Draw or geo-join a Brazilian state, municipality or region; get its centroid and area in km2. Use qualidade=minima unless you need detailed geometry (maxima meshes are megabytes).

## Request contract

* **Method and path:** POST /apis/v1/servicodados-ibge-gov-br/official-statistics/malha
* **Availability:** enabled
* **Request URL template:** `https://api.aisa.one/apis/v1/servicodados-ibge-gov-br/official-statistics/malha`

[Complete OpenAPI definition](https://aisa.one/docs/openapi/servicodados-ibge-gov-br.json)

Effective request declaration (including authentication and referenced schemas):

```json theme={null}
{
  "operationId": "servicodados-ibge-gov-br.official-statistics.malha",
  "method": "POST",
  "path": "/apis/v1/servicodados-ibge-gov-br/official-statistics/malha",
  "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": {
              "id": "3550308",
              "nivel": "municipios"
            }
          }
        },
        "schema": {
          "additionalProperties": true,
          "properties": {
            "id": {
              "description": "IBGE code (35 or SP for a state, 3550308 for a municipality, BR for the country). Pattern: ^[A-Za-z0-9]{1,9}$.",
              "type": "string"
            },
            "intrarregiao": {
              "description": "Split the mesh into the localities of this level (e.g. municipio inside a state).\n\nProvider reference: allowed values [\"regiao\", \"UF\", \"mesorregiao\", \"microrregiao\", \"regiao-intermediaria\", \"regiao-imediata\", \"municipio\"].",
              "type": "string",
              "x-alexandria-option-metadata": {
                "in": "body",
                "oneOf": [
                  "regiao",
                  "UF",
                  "mesorregiao",
                  "microrregiao",
                  "regiao-intermediaria",
                  "regiao-imediata",
                  "municipio"
                ]
              }
            },
            "nivel": {
              "description": "nivel\n\nProvider reference: allowed values [\"paises\", \"regioes\", \"estados\", \"mesorregioes\", \"microrregioes\", \"regioes-intermediarias\", \"regioes-imediatas\", \"municipios\"].",
              "type": "string"
            },
            "qualidade": {
              "default": "minima",
              "description": "qualidade\n\nProvider reference: allowed values [\"minima\", \"intermediaria\", \"maxima\"]; default \"minima\".",
              "type": "string",
              "x-alexandria-option-metadata": {
                "in": "body",
                "oneOf": [
                  "minima",
                  "intermediaria",
                  "maxima"
                ]
              }
            }
          },
          "required": [
            "id",
            "nivel"
          ],
          "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/servicodados-ibge-gov-br.json POST /apis/v1/servicodados-ibge-gov-br/official-statistics/malha
openapi: 3.1.0
info:
  description: ''
  title: IBGE service data API
  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:
    servicodados-ibge-gov-br:
      description: ''
      title: IBGE service data API
      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: 518fc4ef947cdae694909b6b92a592a19c91435c3047395d9357e9329503c138
        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/servicodados-ibge-gov-br/official-statistics/agregado-dados
    - /apis/v1/servicodados-ibge-gov-br/official-statistics/agregado-metadados
    - /apis/v1/servicodados-ibge-gov-br/official-statistics/agregados
    - /apis/v1/servicodados-ibge-gov-br/official-statistics/calendario
    - /apis/v1/servicodados-ibge-gov-br/official-statistics/cnae
    - /apis/v1/servicodados-ibge-gov-br/official-statistics/localidade
    - /apis/v1/servicodados-ibge-gov-br/official-statistics/localidades
    - /apis/v1/servicodados-ibge-gov-br/official-statistics/malha
    - /apis/v1/servicodados-ibge-gov-br/official-statistics/nomes
    - /apis/v1/servicodados-ibge-gov-br/official-statistics/nomes-ranking
    - /apis/v1/servicodados-ibge-gov-br/official-statistics/noticias
    - /apis/v1/servicodados-ibge-gov-br/official-statistics/paises
  x-aisa-document:
    composer_version: '31'
    document_hash: sha256:384fbccd466b93a5e759ab66f0bb4bd9d7246110b99aeaf8b08945bfa155d106
    facts_hash: 518fc4ef947cdae694909b6b92a592a19c91435c3047395d9357e9329503c138
    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: servicodados-ibge-gov-br
servers:
  - url: https://api.aisa.one
security:
  - bearerAuth: []
paths:
  /apis/v1/servicodados-ibge-gov-br/official-statistics/malha:
    post:
      tags:
        - IBGE service data API
      summary: Malha
      description: >-
        Draw or geo-join a Brazilian state, municipality or region; get its
        centroid and area in km2. Use qualidade=minima unless you need detailed
        geometry (maxima meshes are megabytes).
      operationId: servicodados-ibge-gov-br.official-statistics.malha
      requestBody:
        content:
          application/json:
            examples:
              provider:
                summary: >-
                  Official provider example; checked against AIsa request
                  constraints
                value:
                  id: '3550308'
                  nivel: municipios
            schema:
              additionalProperties: true
              properties:
                id:
                  description: >-
                    IBGE code (35 or SP for a state, 3550308 for a municipality,
                    BR for the country). Pattern: ^[A-Za-z0-9]{1,9}$.
                  type: string
                intrarregiao:
                  description: >-
                    Split the mesh into the localities of this level (e.g.
                    municipio inside a state).


                    Provider reference: allowed values ["regiao", "UF",
                    "mesorregiao", "microrregiao", "regiao-intermediaria",
                    "regiao-imediata", "municipio"].
                  type: string
                  x-alexandria-option-metadata:
                    in: body
                    oneOf:
                      - regiao
                      - UF
                      - mesorregiao
                      - microrregiao
                      - regiao-intermediaria
                      - regiao-imediata
                      - municipio
                nivel:
                  description: >-
                    nivel


                    Provider reference: allowed values ["paises", "regioes",
                    "estados", "mesorregioes", "microrregioes",
                    "regioes-intermediarias", "regioes-imediatas",
                    "municipios"].
                  type: string
                qualidade:
                  default: minima
                  description: >-
                    qualidade


                    Provider reference: allowed values ["minima",
                    "intermediaria", "maxima"]; default "minima".
                  type: string
                  x-alexandria-option-metadata:
                    in: body
                    oneOf:
                      - minima
                      - intermediaria
                      - maxima
              required:
                - id
                - nivel
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              examples:
                provider:
                  description: Published by the provider on 2026-09-22.
                  summary: Official provider example
                  value:
                    feature_count: 1
                    geojson:
                      features:
                        - geometry:
                            coordinates:
                              - - - -46.8061
                                  - -23.9396
                                - - -46.7894
                                  - -23.941
                                - - -46.7422
                                  - -23.9916
                                - - -46.6912
                                  - -23.9849
                                - - -46.6502
                                  - -24.0015
                                - - -46.6116
                                  - -23.9694
                                - - -46.6071
                                  - -23.9536
                                - - -46.6162
                                  - -23.8627
                                - - -46.6324
                                  - -23.8514
                                - - -46.6215
                                  - -23.7846
                                - - -46.6542
                                  - -23.7305
                                - - -46.6177
                                  - -23.7122
                                - - -46.6317
                                  - -23.6966
                                - - -46.6165
                                  - -23.658
                                - - -46.5834
                                  - -23.6412
                                - - -46.5793
                                  - -23.6044
                                - - -46.548
                                  - -23.6061
                                - - -46.5063
                                  - -23.6258
                                - - -46.4854
                                  - -23.623
                                - - -46.4724
                                  - -23.6388
                                - - -46.4154
                                  - -23.6386
                                - - -46.3948
                                  - -23.6124
                                - - -46.3831
                                  - -23.5993
                                - - -46.3946
                                  - -23.5318
                                - - -46.3664
                                  - -23.5122
                                - - -46.3867
                                  - -23.4747
                                - - -46.4121
                                  - -23.4704
                                - - -46.461
                                  - -23.4831
                                - - -46.4937
                                  - -23.4765
                                - - -46.5621
                                  - -23.5001
                                - - -46.5705
                                  - -23.4589
                                - - -46.5669
                                  - -23.4162
                                - - -46.5363
                                  - -23.3636
                                - - -46.5538
                                  - -23.3616
                                - - -46.6006
                                  - -23.3886
                                - - -46.6121
                                  - -23.4173
                                - - -46.6551
                                  - -23.4307
                                - - -46.6697
                                  - -23.4183
                                - - -46.6999
                                  - -23.4234
                                - - -46.7356
                                  - -23.3881
                                - - -46.823
                                  - -23.4011
                                - - -46.8233
                                  - -23.4224
                                - - -46.8005
                                  - -23.4696
                                - - -46.7987
                                  - -23.4706
                                - - -46.7755
                                  - -23.4662
                                - - -46.7601
                                  - -23.5548
                                - - -46.8055
                                  - -23.5876
                                - - -46.8081
                                  - -23.6092
                                - - -46.7505
                                  - -23.604
                                - - -46.7927
                                  - -23.6472
                                - - -46.8013
                                  - -23.686
                                - - -46.7961
                                  - -23.7387
                                - - -46.7773
                                  - -23.7667
                                - - -46.8006
                                  - -23.8017
                                - - -46.7627
                                  - -23.8274
                                - - -46.7761
                                  - -23.8558
                                - - -46.7766
                                  - -23.8927
                                - - -46.8044
                                  - -23.8923
                                - - -46.8109
                                  - -23.9203
                                - - -46.8061
                                  - -23.9396
                            type: Polygon
                          properties:
                            codarea: '3550308'
                          type: Feature
                      type: FeatureCollection
                    id: '3550308'
                    metadados:
                      area:
                        dimensao: '1522.683'
                        unidade:
                          id: km2
                          nome: Quilômetros quadrados
                      centroide:
                        latitude: -23.6504
                        longitude: -46.6482
                      id: '3550308'
                      nivel-geografico: município
                      nome: São Paulo
                      regiao-limitrofe:
                        - latitude: -23.3568
                          longitude: -46.8263
                        - latitude: -24.0082
                          longitude: -46.3651
                    nivel: municipios
                    observed_at_ms: 1790047063790
                    source_url: >-
                      https://servicodados.ibge.gov.br/api/v4/malhas/municipios/3550308?formato=application%2Fvnd.geo%2Bjson&qualidade=minima
              schema:
                not:
                  type: 'null'
                x-aisa-schema-completeness: documented-fields-only
          description: >-
            Territorial mesh (boundary) of one locality from
            /api/v4/malhas/{nivel}/{id} as GeoJSON at a chosen simplification
            quality (minima | intermediaria | maxima), optionally subdivided
            into intra-region features (intrarregiao), plus the mesh metadata
            (/metadados: centroid, bounding box, area).


            The response contains the tool result directly.


            | Documented field | Provider type | Description |

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

            | `feature_count` | number |  |

            | `geojson` | object | GeoJSON FeatureCollection exactly as the
            source returns it. |

            | `id` | string |  |

            | `metadados` | object | Mesh metadata as /metadados returns it: id,
            nome, nivel-geografico, centroide {longitude, latitude},
            regiao-limitrofe (bounding corners), area {dimensao, unidade}. |

            | `nivel` | string |  |

            | `observed_at_ms` | number | Unix epoch milliseconds when this
            program observed the response. |

            | `source_url` | string | The exact servicodados.ibge.gov.br request
            that produced this result. |



            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.