Docs

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.

text
POST https://api.aivana.ai/v1/generate

Authentication

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.

bash
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.

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

json
{
  "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

bash
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.

View in Docs

Managing API Keys

Learn how to create and revoke API keys in Aivana AI Studio.

Create KeyView in Docs

Quickstart Guide

Get your key and make your first request in minutes.

Still have questions? We are here to help!

Try live

Run chat interactively in the Playground without any setup.

On this page

GenerateAuthenticationMinimal requestPrompt or messagesResponseCommon requests

Helpful links

Aivana Status

Was this helpful?

Still have questions? We are here to help!