# Ternary Bonsai 2 9B — Use via Hanzo AI API

> Ternary Bonsai 2 9B is PrismML’s compact, open-weight language model for co... Call via Hanzo's OpenAI-compatible API. Context: 262K.

[Models](https://hanzo.ai/models)/[prism-ml](https://hanzo.ai/models/prism-ml)/ternary-bonsai-2-9b

prism-ml

# Ternary Bonsai 2 9B

Ternary Bonsai 2 9B is PrismML’s compact, open-weight language model for conversational AI, reasoning, and tool use.

[Get API key](https://platform.hanzo.ai/api-keys)[Try in Chat](https://hanzo.ai/chat)

## Specifications

Context Window262K

Modalitiestext

Price…

Model IDprism-ml/ternary-bonsai-2-9b

## Quick start

[Get an API key →](https://platform.hanzo.ai/api-keys)

TypeScript

Python

cURL

Go

TypeScript

```
import OpenAI from 'openai' const client = new OpenAI({ apiKey: process.env.HANZO_API_KEY, baseURL: 'https://api.hanzo.ai/v1' }) const response = await client.chat.completions.create({ model: 'prism-ml/ternary-bonsai-2-9b', messages: [{ role: 'user', content: 'Hello!' }] }) console.log(response.choices[0].message.content)
```

Python

```
from openai import OpenAI client = OpenAI( api_key=os.environ["HANZO_API_KEY"], base_url="https://api.hanzo.ai/v1" ) response = client.chat.completions.create( model="prism-ml/ternary-bonsai-2-9b", messages=[{"role": "user", "content": "Hello!"}] ) print(response.choices[0].message.content)
```

cURL

```
curl https://api.hanzo.ai/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $HANZO_API_KEY" \ -d '{ "model": "prism-ml/ternary-bonsai-2-9b", "messages": [{"role": "user", "content": "Hello!"}] }'
```

Go

```
package main import ( "context" "fmt" "os" "github.com/sashabaranov/go-openai" ) func main() { cfg := openai.DefaultConfig(os.Getenv("HANZO_API_KEY")) cfg.BaseURL = "https://api.hanzo.ai/v1" client := openai.NewClientWithConfig(cfg) resp, _ := client.CreateChatCompletion(context.Background(), openai.ChatCompletionRequest{ Model: "prism-ml/ternary-bonsai-2-9b", Messages: []openai.ChatCompletionMessage{ {Role: openai.ChatMessageRoleUser, Content: "Hello!"}, }, }, ) fmt.Println(resp.Choices[0].Message.Content) }
```

…

## More from prism-ml

[Ternary Bonsai 2 27B262KBonsai 2 27B is a 27B-parameter reasoning model from PrismML derived from Qwen3.8-27B. It supports coding, mathematics, tool calling, and image understanding with a 262K-token context window. Ternary compression shrinks...](https://hanzo.ai/models/prism-ml/ternary-bonsai-2-27b)

[View all prism-ml models →](https://hanzo.ai/models/prism-ml)

## Use Ternary Bonsai 2 9B via Hanzo AI

One API key. Every major model. OpenAI-compatible. Start free.

[Get an API key](https://platform.hanzo.ai/api-keys)[Browse All Models](https://hanzo.ai/models)
