Skip to main content

Documentation Index

Fetch the complete documentation index at: https://aimp.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Execute via API

The public run endpoint is:
POST /api/runs
Every run must include a model, an input object, and optional operation parameters.

curl

curl -X POST "$AIMP_GATEWAY_URL/api/runs" \
  -H "X-API-Key: $AIMP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "demo-model",
    "mode": "execute",
    "scope": "playground",
    "input": {
      "text": "Write a one-line summary."
    },
    "params": {}
  }'

Python

import os
import requests

gateway_url = os.environ["AIMP_GATEWAY_URL"].rstrip("/")
api_key = os.environ["AIMP_API_KEY"]

response = requests.post(
    f"{gateway_url}/api/runs",
    headers={
        "X-API-Key": api_key,
        "Content-Type": "application/json",
    },
    json={
        "model": "demo-model",
        "mode": "execute",
        "scope": "playground",
        "input": {"text": "Write a one-line summary."},
        "params": {},
    },
    timeout=60,
)
response.raise_for_status()
print(response.json())

JavaScript

const gatewayUrl = process.env.AIMP_GATEWAY_URL.replace(/\/$/, "");

const response = await fetch(`${gatewayUrl}/api/runs`, {
  method: "POST",
  headers: {
    "X-API-Key": process.env.AIMP_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "demo-model",
    mode: "execute",
    scope: "playground",
    input: { text: "Write a one-line summary." },
    params: {},
  }),
});

if (!response.ok) {
  throw new Error(`AIMP request failed: ${response.status}`);
}

console.log(await response.json());

Validation checklist

  • model is a published model slug or identifier.
  • mode exists on the model contract.
  • input matches the model input schema.
  • params is an object, even when empty.
  • scope is present for vector-enabled modes.