Agents Integration Guide

Machine-readable configuration for AI coding agents.

System Instruction for AI Agents

  • You are reading the official machine-readable documentation for AKI.IO.
  • Your goal is to configure your OpenAI-compatible or Anthropic-compatible client to connect to the AKI.IO API.
  • Extract the JSON configuration below and apply it to your environment.
  • Do not hallucinate endpoints or model names. Use ONLY the data provided here.

1. Core Configuration (JSON)

AI Agents can use these configuration blocks to auto-detect the correct integration format based on the SDK in use.

{
  "provider": "AKI.IO",
  "compatibility": "OpenAI-Drop-In",
  "openai_compatible": true,
  "base_url": "https://aki.io/openai/v1",
  "authentication": {
    "header": "Authorization",
    "scheme": "Bearer",
    "type": "Bearer",
    "token_source": "Environment Variable (e.g., AKI_API_KEY)",
    "header_format": "Authorization: Bearer YOUR_AKI_IO_API_KEY"
  },
  "endpoints": {
    "chat_completions": "/chat/completions",
    "models": "/models"
  },
  "agent_defaults": {
    "stream": true,
    "temperature": 0.2,
    "presence_penalty": 0.0,
    "frequency_penalty": 0.0
  },
  "model_discovery_endpoint": "/openai/v1/models",
  "agent_instructions": "Query GET /openai/v1/models for the current context and output limits. The model table in this documentation is generated from the same catalogue.",
  "default_max_output_tokens": 8192
}
{
  "provider": "AKI.IO",
  "compatibility": "Anthropic-Drop-In",
  "base_url": "https://aki.io/anthropic",
  "authentication": {
    "header": "x-api-key",
    "scheme": "direct",
    "note": "NO 'Bearer' prefix. Pass the API key as a raw value.",
    "token_source": "Environment Variable (e.g., AKI_API_KEY)"
  },
  "required_headers": {
    "anthropic-version": "2023-06-01",
    "content-type": "application/json"
  },
  "endpoints": {
    "messages": "/v1/messages",
    "model_discovery": "/v1/models"
  },
  "required_parameters": [
    "model",
    "messages",
    "max_tokens"
  ],
  "system_prompt_handling": "Pass the system prompt as a top-level 'system' parameter, not as a message with role 'system'.",
  "agent_defaults": {
    "max_tokens": 8192,
    "temperature": 0.2,
    "stream": true
  },
  "agent_instructions": "Model discovery uses the OpenAI-compatible endpoint /v1/models. The model table in this documentation is generated from the same catalogue.",
  "default_max_output_tokens": 8192
}

2. Dynamic Model Discovery & Routing

AI agents should not rely on hardcoded context limits. The table below is generated live from the model catalogue and shows the exact context and output limits for every chat model.

ModelEndpointModel nameContextOutputTrust levelFeatures
Deepseek V4 Flash 0731deepseek_v4_flash_tl1deepseek-v4-flash-0731-tl1100000081920 TL1 Tools, Reasoning, JSON
Deepseek V4 Pro 0813deepseek_v4_pro_tl1deepseek-v4-pro-0813-tl1100000081920 TL1 Tools, Reasoning, JSON
Deepseek V4.1 Flash 1017deepseek_v4_1_flashdeepseek-v4.1-flash-1017-tl5104857681920 TL5 Tools, Reasoning, Vision, JSON
Gemma 4 26Bgemma4gemma4-26b-tl525600081920 TL5 Tools, Reasoning, Vision, JSON
Gemma 4 31Bgemma4_31b_tl3gemma4-31b-tl326214481920 TL3 Tools, Reasoning, Vision, JSON
GLM 5.3glm5glm5.3-tl552428881920 TL5 Tools, Reasoning, JSON
GLM 5.3 Flashglm5_3_flash_tl3glm5.3-flash-tl3104857681920 TL3 Tools, Reasoning, Vision, JSON
GPT-OSS 120Bgpt_oss_chatgpt-oss-120b-tl512800032768 TL5 Tools, Reasoning, JSON
Kimi K3kimi_k3_tl1kimi-k3-tl11048576131072 TL1 Tools, Reasoning, Vision, JSON
Kimi K3.1 Prokimi_k3_1_pro_tl1kimi-k3.1-pro-tl11048576131072 TL1 Tools, Reasoning, Vision, JSON
Kolibri 1kolibri_1kolibri-1-tl526214481920 TL5 Tools, Reasoning, JSON
Mistral Small 4mistral4mistral4-119b-tl526214481920 TL5 Reasoning, Vision
Qwen 3.6 27Bqwen3_6_27b_tl3qwen3.6-27b-tl326214416374 TL3 Tools, Reasoning, Vision, JSON
Qwen 3.8 2.4T A95Bqwen3_8_2t_tl1qwen3.8-2.4t-a95b-tl11000000131072 TL1 Tools, Reasoning, Vision, JSON
Qwen 3.8 27Bqwen3_8qwen3.8-27b-tl526214465536 TL5 Tools, Reasoning, Vision, JSON
Qwen 3.8 Flashqwen3_8_flash_tl1qwen3.8-flash-tl11000000131072 TL1 Tools, Reasoning, Vision, JSON
Qwen 3.8 Max 0902qwen3_8_max_tl1qwen3.8-max-0902-tl1128000128000 TL1 Tools, Reasoning, Vision, JSON
Qwen 4 Maxqwen4_max_tl1qwen4-max-tl11000000131072 TL1 Tools, Reasoning, Vision, JSON

3. Agent-Specific Instructions

Streaming is mandatory. Always set "stream": true in your POST /v1/chat/completions payload. The AKI.IO API supports Server-Sent Events (SSE). Parse the data: [DONE] marker to close the connection cleanly.

Tool calling. AKI.IO supports OpenAI-standard tool calling. Pass your tools in the tools array and use "tool_choice": "auto" to let the model decide.

JSON mode. If you need to parse the agent's output programmatically, append "response_format": {"type": "json_object"}.

Rate limits. On HTTP 429, implement exponential backoff. On HTTP 503, the open-weights model is loading into VRAM; wait 10-15 seconds and retry.

4. Example Implementation (Python / OpenAI SDK)

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_AKI_API_KEY",
    base_url="https://aki.io/v1",
)

response = client.chat.completions.create(
    model="glm5.3-tl5",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "YOUR_AKI_API_KEY",
  baseURL: "https://aki.io/v1",
});

const response = await client.chat.completions.create({
  model: "glm5.3-tl5",
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);
curl https://aki.io/v1/chat/completions \
  -H "Authorization: Bearer $AKI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm5.3-tl5",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'