API Reference

Complete reference for all AI Metal Cluster endpoints.

Authentication

All API requests require authentication using a Bearer token in the Authorization header.

Authorization: Bearer YOUR_API_KEY

Security Note: API keys are issued per-cluster and can be rotated via the admin dashboard. Never expose keys in client-side code.

LLM Queries

POST /query

Request Body

Parameter Type Required Description
prompt string Yes The input prompt
model string No Model ID (default: llama3.2)
max_tokens integer No Maximum response tokens (default: 2048)
temperature float No Sampling temperature 0-2 (default: 0.7)
stream boolean No Enable streaming response (default: false)

Example Request

curl -X POST https://cluster.example.com/query \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Explain machine learning",
    "model": "llama3.2",
    "max_tokens": 500
  }'

Transcription

POST /transcribe

Form Parameters

Parameter Type Required Description
file file Yes Audio file (mp3, wav, m4a, etc.)
language string No ISO language code (auto-detected if omitted)
format string No Output format: text, srt, vtt (default: text)

Example Request

curl -X POST https://cluster.example.com/transcribe \
  -H "Authorization: Bearer sk_live_xxx" \
  -F "[email protected]" \
  -F "language=en" \
  -F "format=srt"

Image Generation

POST /generate-image

Request Body

Parameter Type Required Description
prompt string Yes Image description
width integer No Image width (default: 1024)
height integer No Image height (default: 1024)
steps integer No Inference steps (default: 20)

Animation

POST /animate

Generate video animations from images using SVD, LivePortrait, or D-ID.

Animation endpoints require Professional tier or higher. Contact sales for access.

Error Codes

Code Meaning
400 Bad Request - Invalid parameters
401 Unauthorized - Invalid or missing API key
403 Forbidden - IP not whitelisted
429 Rate Limited - Too many requests
500 Internal Error - Server issue
503 Service Unavailable - Model loading