API Reference
Generate
Generate
Send a prompt to Aivana MMI and get one synthesized answer back.
POST /v1/generate is the main endpoint of the Aivana API. You send a prompt; Aivana decides how much intelligence the request needs, uses one or several AI models as appropriate, reconciles their work, and returns a single answer. You don't choose or manage the models.
POST https://api.aivana.ai/v1/generateAuthentication
Send your API key in the X-API-Key header on every request. Create a key on the API Keys page. The secret is shown only once; keep it on your server, in a secret manager or an environment variable, and never in browser or mobile code.
Minimal request
Only a prompt is needed. Every other option is optional; see Parameters.
curl https://api.aivana.ai/v1/generate \
-H "X-API-Key: $AIVANA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "Write a haiku about the ocean."}'Prompt or messages
For a single question, send prompt (up to 200,000 characters). For a multi-turn exchange, send messages instead: up to 40 items, each with a role of system, user or assistant and a content string, oldest first. See Conversations.
{
"messages": [
{ "role": "system", "content": "You are a concise support lead." },
{ "role": "user", "content": "A customer wants a refund after 40 days." }
]
}Response
A successful call returns 200 with the answer and what the request used. This example is abridged; Responses & Usage describes every field.
{
"id": "gen_...",
"request_id": "req_...",
"answer": "Waves fold and unfold, ...",
"usage": { "input_tokens": 14, "output_tokens": 22, "cached_tokens": 0, "credits": 0.0001 },
"latency_ms": 2140,
"finish_reason": "stop",
"notices": []
}Common requests
curl https://api.aivana.ai/v1/generate \
-H "X-API-Key: $AIVANA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "What is the default port for Postgres?", "effort": "low"}'The JSON Schema (Strict) request returns the validated object in structured, or an error: see Structured Outputs.
No model picker, on purpose
There are no model or provider settings. Aivana manages the intelligence path for each request, and effort sets how much intelligence it may apply.
Learn more
Parameters
Every option the Generate API accepts.
Managing API Keys
Learn how to create and revoke API keys in Aivana AI Studio.
Quickstart Guide
Get your key and make your first request in minutes.
Still have questions? We are here to help!