{
  "kind": "aggregator",
  "basic": {
    "name": "",
    "short_title": "AI text completion API",
    "version": "1.0",
    "category": "LLM / Generative AI",
    "tags": "ai, llm, completion, chat",
    "about": "## What this API does\n\nA managed AI completion endpoint backed by an OpenAI-compatible upstream. Buyers send messages; the model choice and your upstream key stay private, so you control cost and quality.\n\n## How buyers call it\n\nPOST a JSON body like the sample; the unified response contains just the answer text.",
    "status": "private"
  },
  "routes": [
    {
      "name": "Chat completion",
      "playground_path": "/ai/complete",
      "method": "POST",
      "mode": "failover",
      "headers": [],
      "body_mode": "raw_json",
      "body_payload": {
        "private": "",
        "public_sample": "{\"messages\": [{\"role\": \"user\", \"content\": \"Write a haiku about APIs\"}]}"
      },
      "body_fields": [],
      "output_schema": {
        "answer": "string",
        "model": "string"
      },
      "request_policy": {
        "max_requests_per_buyer_per_day_paid": 500,
        "max_requests_total_trial": 3,
        "estimated_total_requests": 100000
      },
      "sources": [
        {
          "label": "OpenAI-compatible upstream",
          "method": "POST",
          "url": "https://api.openai.com/v1/chat/completions",
          "headers": [
            { "key": "Authorization", "value": "Bearer {{YOUR_LLM_API_KEY}}" },
            { "key": "Content-Type", "value": "application/json" }
          ],
          "body_mode": "raw_json",
          "body_payload": {
            "private": "{\"model\": \"{{YOUR_MODEL_NAME}}\", \"max_tokens\": 500}",
            "public_sample": ""
          },
          "body_fields": [],
          "response_type": "json",
          "rate_limits": [
            { "window": "minute", "count": 30 },
            { "window": "day", "count": 2000 }
          ],
          "request_mapping": [],
          "schema_mapping": {
            "answer": "choices[0].message.content",
            "model": "model"
          },
          "proxy": {
            "enabled": true,
            "required": true,
            "visibility": "private",
            "value": {
              "hostname": "{{YOUR_PROXY_HOST_PORT}}",
              "username": "{{YOUR_PROXY_USERNAME}}",
              "password": "{{YOUR_PROXY_PASSWORD}}"
            }
          }
        }
      ]
    }
  ],
  "pricing": {
    "requests_per_credit": 10,
    "plans": [],
    "trial_enabled": true,
    "trial_requests": 3
  }
}
