API Reference

IIO AI Platform — OpenAI-compatible REST API v1

Base URL & Authentication

BASEhttps://api.iio.space/v1

All requests require a Bearer token in the Authorization header:

Authorization: Bearer iio-dev-{your-api-key}
Content-Type: application/json
X-IIO-Tenant: {tenant-id}   // optional — for multi-tenant routing

Get your API key on the Developer Portal. Keys start with iio-dev-.

POST Chat Completions

POST/v1/chat/completions

Creates a model response for the given conversation. OpenAI-compatible.

REQUEST BODY

ParameterTypeRequiredDescription
modelstringrequiredModel ID (see Model Catalog)
messagesarrayrequiredArray of message objects with role and content
streambooleanoptionalStream tokens as SSE. Default: false
temperaturenumberoptional0–2. Default: 1.0
max_tokensintegeroptionalMax tokens to generate
systemstringoptionalSystem prompt (alternative to messages[0].role=system)

EXAMPLE REQUEST

{
  "model": "qwen2.5:7b",
  "messages": [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user",   "content": "Summarize AI governance in 3 sentences."}
  ],
  "stream": false,
  "temperature": 0.7
}

EXAMPLE RESPONSE

{
  "id": "chatcmpl-iio-abc123",
  "object": "chat.completion",
  "created": 1748390400,
  "model": "qwen2.5:7b",
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "AI governance ensures responsible development..."
    },
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 28,
    "completion_tokens": 87,
    "total_tokens": 115
  }
}

GET List Models

GET/v1/models

Returns all available models for your API key tier.

{
  "object": "list",
  "data": [
    {"id": "qwen2.5:7b",   "object": "model", "owned_by": "iio"},
    {"id": "qwen2.5:72b",  "object": "model", "owned_by": "iio"},
    {"id": "nomic-embed-text", "object": "model", "owned_by": "iio"}
  ]
}

POST Embeddings

POST/v1/embeddings
ParameterTypeRequiredDescription
modelstringrequirednomic-embed-text or qwen3-embedding:8b
inputstring|arrayrequiredText or array of texts to embed
{
  "model": "nomic-embed-text",
  "input": "AI governance framework for SMBs"
}

GET Health

GET/v1/health
{"status": "ok", "cells": 4, "models": 8, "latency_ms": 12}

Error Codes

HTTPCodeCauseFix
401auth_requiredMissing or invalid API keyAdd Authorization: Bearer {key}
403tier_exceededMonthly request limit reachedUpgrade tier or wait for reset
422invalid_modelModel not available on your tierUse GET /v1/models to list available models
429rate_limitedToo many requests per minuteRespect Retry-After header
503cell_unavailableAI Hub cell temporarily downRetry after 30s; check /v1/health

Rate Limits

TierRequests / minRequests / monthModels
Free101,000qwen2.5:7b only
Pro6050,000All models
EnterpriseunlimitedcustomAll + dedicated cell

Rate limit headers on every response: X-RateLimit-Limit · X-RateLimit-Remaining · X-RateLimit-Reset