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

# Get rule language reference

> Returns the complete rule language as one Markdown document: what Anafi is, how to
write a rule, worked examples, and the full schema. Each network host renders the
page for its own network, so the page names that chain and the tokens that the
engine can move there.

- Who may call: anyone. The route needs no sign-in and no key, so you can give the
  URL to an AI agent.
- Before: nothing.
- Guarantee: the page does not change while one release of the API runs. The
  response has `Cache-Control: public, max-age=3600`.

The page is a document. It commits nothing. See [Rule language](/rules/overview).




## OpenAPI

````yaml /api/openapi.yaml get /api/dsl/docs
openapi: 3.1.0
info:
  title: Anafi API
  version: 0.3.0
  summary: The public HTTP API of one Anafi network.
  description: >
    The Anafi API is the HTTP surface of one Anafi network. Each network has its
    own host.

    The public TypeScript SDK `@anafi-cc/anafi-sdk` calls these routes for you,
    and it also

    builds and checks the signed and sealed payloads. You can call the routes
    directly.


    - No API key is necessary today.

    - Request and response bodies are JSON, except where an operation says
    otherwise.

    - A route that carries a confidential payload takes an HPKE-sealed envelope.
    Read
      [Sealed requests](/api-reference/sealed-requests) before you call it without the SDK.
    - Read [Introduction](/api-reference/introduction) for formats and
      [Errors](/api-reference/errors) for the error bodies.

    Browser origin: the API hosts answer CORS only for `https://app.ana.fi`
    today. A browser

    page on another origin cannot call the API directly. A server, a script, or
    your own

    same-origin proxy can call it.
servers:
  - url: https://api.polygon.ana.fi
    description: Polygon PoS (chain id 137)
  - url: https://api.xlayer.ana.fi
    description: X Layer (chain id 196)
  - url: https://api.polygon-amoy.ana.fi
    description: Polygon Amoy testnet (chain id 80002)
security: []
tags:
  - name: Accounts
    description: >-
      Find the accounts of an owner address, and deploy the 1-of-1 Safe of an
      owner.
  - name: Safe relay
    description: Submit an owner-signed Safe transaction. Anafi pays the gas.
  - name: Rules
    description: >-
      Stage a sealed rule document. The engine returns the attestation for the
      on-chain commit.
  - name: Confidential channel
    description: >-
      Read back the rule document and the account state of an account through a
      sealed channel.
  - name: Notification email
    description: Verify the email address that rule notifications go to.
  - name: Activity
    description: Read the payments that the engine made for an account.
  - name: Fees
    description: Read the fee terms of the network and the sponsorship of an account.
  - name: Payments
    description: Ask for the email receipt of a payment made on the pay page.
  - name: Rule language
    description: >-
      Read the rule language reference, and write a rule document from a
      description.
  - name: Bank payouts
    description: >
      Connect a Safe to Monerium for bank payouts in euro, and read the state of
      the

      connection and of the orders. These routes are served only on
      `polygon-amoy`

      (Monerium sandbox). The `polygon` and `xlayer` hosts answer `404`.
  - name: Status
    description: Check that the Anafi API answers.
paths:
  /api/dsl/docs:
    get:
      tags:
        - Rule language
      summary: Get rule language reference
      description: >
        Returns the complete rule language as one Markdown document: what Anafi
        is, how to

        write a rule, worked examples, and the full schema. Each network host
        renders the

        page for its own network, so the page names that chain and the tokens
        that the

        engine can move there.


        - Who may call: anyone. The route needs no sign-in and no key, so you
        can give the
          URL to an AI agent.
        - Before: nothing.

        - Guarantee: the page does not change while one release of the API runs.
        The
          response has `Cache-Control: public, max-age=3600`.

        The page is a document. It commits nothing. See [Rule
        language](/rules/overview).
      operationId: getDslReference
      responses:
        '200':
          description: The Markdown reference of the rule language for this network.
          headers:
            Cache-Control:
              description: Always `public, max-age=3600`.
              schema:
                type: string
                const: public, max-age=3600
          content:
            text/markdown:
              schema:
                type: string
              example: >
                Anafi is a privacy-preserving, non-custodial automation engine
                on Polygon PoS, ...

````

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