Ternary Bonsai 2 27B API

prism-ml/ternary-bonsai-2-27b
A ternary multimodal 27B model from PrismML, good at reasoning, coding, vision, and agentic tool use on local devices.
Context
262K tokens
Input
$0.103155 / 1M tokens
Output
$0.6877 / 1M tokens
Released
Sep 18, 2026

How to use Ternary Bonsai 2 27B API

Install any OpenAI-compatible SDK, point it at api.aimlapi.com/v1, and set the model to prism-ml/ternary-bonsai-2-27b.
import requests

r = requests.post(
    "https://api.aimlapi.com/v1/chat/completions",
    headers={"Authorization": "Bearer " + AIMLAPI_KEY},
    json={
      "model": "prism-ml/ternary-bonsai-2-27b",
      "messages": [
        {
          "role": "user",
          "content": "Hello!"
        }
      ]
    },
)
print(r.json())
const r = await fetch("https://api.aimlapi.com/v1/chat/completions", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.AIMLAPI_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "model": "prism-ml/ternary-bonsai-2-27b",
    "messages": [
      {
        "role": "user",
        "content": "Hello!"
      }
    ]
  }),
});
console.log(await r.json());
curl -X POST https://api.aimlapi.com/v1/chat/completions \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"prism-ml/ternary-bonsai-2-27b","messages":[{"role":"user","content":"Hello!"}]}'

OpenAI-compatible — swap the base URL and it works with your existing SDK.

Ternary Bonsai 2 27B API Pricing

TypePrice
Input
$0.103155 / 1M tokens
Output
$0.6877 / 1M tokens

Ternary Bonsai 2 27B is free to integrate using the Puter.js AI API, and Puter’s user-pays model says app developers can add it for $0 because users cover their own AI usage through

Ternary Bonsai 2 27B Benchmarks

BenchmarkScoreWhat it measuresSourceRetrieved
GSM8K
96.66
Grade-school maths word problems requiring multi-step arithmeticSourceSeptember 22, 2026
AIME 2025
95.00
Competition mathematics (AIME), 2025SourceSeptember 22, 2026
LiveCodeBench
90.07
Contamination-free competitive programming problemsSourceSeptember 22, 2026

The primary published source is PrismML’s official “Ternary Bons Source: https://prismml.com/news/bonsai-2-27b

Frequently asked questions

No items found.

Start building with Ternary Bonsai 2 27B

Get API Key
1000+ models, one API.