Overview
a21e exposes an OpenAI-compatible/v1/chat/completions endpoint. If your application already uses the OpenAI SDK, you can switch to a21e by changing two lines — the base URL and API key.
Setup
Model mapping
Themodel parameter maps to a21e’s tier system:
| Value | a21e tier | Behavior |
|---|---|---|
auto | Auto | a21e selects the best model |
economy | Economy | Fastest, lowest cost |
standard | Standard | Balanced |
premium | Premium | Highest quality |
Any model name (e.g., gpt-4o) | Auto | Accepted but a21e selects the actual model |
What’s different from raw OpenAI
When you use a21e’s OpenAI-compatible endpoint, your request gets the full a21e pipeline:- Prompt synthesis — your message is enhanced with curated techniques
- Memory injection — relevant memories from past sessions are applied
- Workspace context — preferences, persona, and repo context are included
- Quality scoring — outputs are scored for continuous improvement
Streaming
Streaming is supported via the standardstream: true parameter: