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

# Intents

> Submit natural-language intents and get expert AI results.

## Overview

An intent is the core unit of work in a21e. You describe what you need in plain language, and a21e handles prompt engineering, model selection, and execution.

## Submitting an intent

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.a21e.com/v1/rpc \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "method": "intent.submit",
      "params": {
        "input": "Write a database migration to add soft-delete to the users table",
        "auto_execute": true,
        "model_tier": "standard"
      }
    }'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.a21e.com/v1/rpc",
      headers={"Authorization": "Bearer YOUR_API_KEY"},
      json={
          "method": "intent.submit",
          "params": {
              "input": "Write a database migration to add soft-delete to the users table",
              "auto_execute": True,
              "model_tier": "standard",
          },
      },
  )
  ```
</CodeGroup>

## Parameters

| Parameter               | Type    | Default    | Description                                                  |
| ----------------------- | ------- | ---------- | ------------------------------------------------------------ |
| `input`                 | string  | *required* | Natural-language description of what you want                |
| `auto_execute`          | boolean | `true`     | Execute immediately after prompt compilation                 |
| `model_tier`            | string  | `"auto"`   | Model quality tier: `auto`, `economy`, `standard`, `premium` |
| `fail_open`             | boolean | `true`     | Allow flexible matching when exact intent match isn't found  |
| `explicit_instructions` | string  | —          | Additional context or constraints for this specific request  |

## Response

```json theme={null}
{
  "intent_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "completed",
  "auto_executed": true,
  "execution_preview": "Here's a PostgreSQL migration...",
  "context_used": [
    { "source": "memory", "description": "3 relevant memory items retrieved", "items": 3 },
    { "source": "repository", "description": "owner/repo - 5 files inspected", "items": 5 }
  ]
}
```

## Model tier selection

When `model_tier` is `"auto"` (the default), a21e analyzes your intent's complexity and selects the appropriate tier:

* **Simple lookups, formatting, boilerplate** → economy tier
* **Code generation, writing, analysis** → standard tier
* **Architecture decisions, security audits, multi-step reasoning** → premium tier

You can override this by specifying a tier explicitly.

## Intent follow-ups

After receiving a response, you can continue the conversation by submitting a follow-up intent with the same `intent_id`:

```json theme={null}
{
  "method": "intent.submit",
  "params": {
    "input": "Now add an index on the deleted_at column",
    "intent_id": "550e8400-e29b-41d4-a716-446655440000",
    "auto_execute": true
  }
}
```

Follow-ups carry forward the conversation context and any relevant memory.
