AEVNI Public API
Optimize and create prompts programmatically from any app or pipeline.
https://aevni.website/api/v1
· All requests and responses use JSON.
The AEVNI API exposes two operations:
- Optimize — reduce the token count of an existing prompt while preserving intent.
- Create — generate a well-structured prompt from a plain-language description.
Both endpoints are authenticated and require an X-AEVNI-Key header.
You also bring your own LLM API key via X-Provider-Key.
⚡ Playground
Probá la API en vivo con tu propia AEVNI key. Las keys quedan solo en tu navegador.
Authentication
Every request must include two headers:
| Header | Description |
|---|---|
X-AEVNI-Key |
Your AEVNI platform key. Identifies your account and tracks usage. Contact us to get one. |
X-Provider-Key |
Your LLM provider API key (Gemini, OpenAI, etc.). Only required for paid providers. Never sent to external servers — used only to call the selected provider. |
Alternatively, pass api_key in the JSON body instead of X-Provider-Key.
# Example — curl
curl -X POST https://aevni.website/api/v1/optimize \
-H "Content-Type: application/json" \
-H "X-AEVNI-Key: aevni_your_key_here" \
-H "X-Provider-Key: AIza..." \
-d '{"prompt": "Explain quantum entanglement", "provider": "gemini", "mode": "pro"}'
Errors
All errors return a JSON body with error (human-readable message) and code (machine-readable slug).
| HTTP | Code | Meaning |
|---|---|---|
| 400 | bad_provider / bad_mode | Invalid parameter value. |
| 401 | missing_key | X-AEVNI-Key header is absent. |
| 401 | invalid_key | X-AEVNI-Key is invalid or revoked. |
| 401 | missing_provider_key | The selected provider requires an API key. |
| 413 | prompt_too_long | Prompt exceeds 500 000 characters. |
| 429 | rate_limited | Provider quota exhausted or our rate limit hit. |
| 503 | provider_unavailable | Provider is down or unreachable. |
| 500 | internal_error | Unexpected server error. |
{
"error": "API key inválida o revocada.",
"code": "invalid_key"
}
Rate limits
Both v1 endpoints allow 60 requests per minute per IP. Beyond that you'll receive HTTP 429.
Provider-side rate limits (Gemini RPM, etc.) are separate — the rate_limited code distinguishes them.
POST /v1/optimize
https://aevni.website/api/v1/optimize
Reduce the token count of an existing prompt while preserving its meaning, structure, and intent.
Request body
| Field | Type | Description | |
|---|---|---|---|
prompt | string | required | The prompt to optimize. Max 500 000 characters. |
provider | string | optional | LLM provider. Default: gemini. See Providers. |
mode | string | optional | pro | lite | auto. Default: pro. See Modes. |
api_key | string | optional | Provider API key. Alternative to X-Provider-Key header. |
Response
{
"optimized": "...", // optimized prompt in original language
"optimized_en": "...", // English version (often saves more tokens)
"detected_lang": "es", // "es" or "en"
"prompt_type": "task_structured",
"report": {
"original_tokens": 120,
"optimized_tokens": 74,
"optimized_en_tokens": 68,
"tokens_saved": 46,
"token_reduction_pct": 38.3,
"chars_saved": 210,
"density_original": 4.2,
"density_optimized": 5.1,
"detected_language": "es"
},
"recommendation": {
"model": "gemini-2.5-flash",
"reason": "...",
"cost_tier": "low"
},
"meta": {
"provider": "gemini",
"mode": "pro",
"mode_resolved": "pro"
}
}
Example
curl -X POST https://aevni.website/api/v1/optimize \
-H "Content-Type: application/json" \
-H "X-AEVNI-Key: aevni_..." \
-H "X-Provider-Key: AIza..." \
-d '{"prompt":"You are an expert assistant. Your job is to help users with their questions in a kind and friendly manner. Always be polite.","provider":"gemini","mode":"auto"}'
POST /v1/create
https://aevni.website/api/v1/create
Generate a well-structured prompt from a plain-language description of what you need.
Request body
| Field | Type | Description | |
|---|---|---|---|
description | string | required | What the prompt should do. Free-form natural language. |
provider | string | optional | Default: pollinations (free). See Providers. |
requirements | string | optional | One requirement per line (bullets OK). Or pass an array of strings. |
output_format | string | optional | Describe the desired output structure (e.g. "JSON array of objects"). |
tone | string | optional | neutral | formal | technical | simple | direct. Default: neutral. |
audience | string | optional | general | developer | manager | student | expert. Default: general. |
forced_type | string | optional | Force a structural type. One of the types in Prompt types. |
api_key | string | optional | Provider API key. Alternative to X-Provider-Key. |
Response
{
"prompt_type": "task_structured",
"created_prompt_es": "...", // prompt in user's language
"created_prompt_en": "...", // English version
"tokens_es": 95,
"tokens_en": 88,
"explanation": "Why this structure was chosen...",
"tips": ["Add examples to improve accuracy", "..."],
"meta": {
"provider": "pollinations",
"tone": "technical",
"audience": "developer",
"forced_type": null
}
}
Example
curl -X POST https://aevni.website/api/v1/create \
-H "Content-Type: application/json" \
-H "X-AEVNI-Key: aevni_..." \
-d '{"description":"A customer support agent for a SaaS app","tone":"formal","audience":"general","provider":"pollinations"}'
Providers
Pass the provider string in your request body.
| ID | Name | Key required? | Notes |
|---|---|---|---|
pollinations | Pollinations AI | No — free | Default for /create. No API key needed. |
gemini | Google Gemini 2.5 Flash | Yes | Default for /optimize. Best quality. |
openai | OpenAI GPT-4o mini | Yes | |
groq | Groq — Llama 3.3 70B | Yes | Fastest inference. |
deepseek | DeepSeek Chat | Yes | |
cerebras | Cerebras — 120B | Yes | |
sambanova | SambaNova — Llama 3.3 70B | Yes | |
openrouter | OpenRouter — Llama 3.1 8B | Yes | Free tier available on OpenRouter. |
anthropic | Anthropic Claude Haiku | Yes |
Modes
| Mode | Description |
|---|---|
pro | Deep optimization with XML schema enforcement. Best for structured/complex prompts. |
lite | Fast compression without structural rewriting. Good for short conversational prompts. |
auto | Automatically picks pro or lite based on prompt complexity heuristics. |
Prompt types
AEVNI detects the structural type of your prompt automatically. You can override it with forced_type in /v1/create.
| Type | Description |
|---|---|
task_structured | Prompts with explicit sections: role, task, constraints, output format. |
conversational | Short questions or natural-language requests without formal structure. |
system_prompt | Agent persona/instruction blocks (system-role prompts). |
agentic | Multi-step reasoning or tool-use prompts. |
creative | Writing, storytelling, or open-ended creative tasks. |
Questions? hola@aevni.website · Back to app