Skip to main content

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

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"
    }
  }'

Parameters

ParameterTypeDefaultDescription
inputstringrequiredNatural-language description of what you want
auto_executebooleantrueExecute immediately after prompt compilation
model_tierstring"auto"Model quality tier: auto, economy, standard, premium
fail_openbooleantrueAllow flexible matching when exact intent match isn’t found
explicit_instructionsstringAdditional context or constraints for this specific request

Response

{
  "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:
{
  "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.