[Integrations](https://spiral.ai/integrations) › [Claude Code](https://spiral.ai/integrations/claude-code) › [Ternary Bonsai 2 27B](https://spiral.ai/integrations/claude-code/ternary-bonsai-2-27b)

# How to Use Ternary Bonsai 2 27B in Claude Code

Ternary Bonsai 2 27B suits code debugging, math problems, and long-document analysis. Compared with Ternary Bonsai 27B, it retains more of its full-precision baseline's benchmark performance, according to PrismML.

|  |  |
| --- | --- |
| Model | Ternary Bonsai 2 27B |
| Available through | OpenRouter |
| Category | LLM |
| Price | Up to $0.002667 per run at the default inputs. $0.0975 per 1M input tokens, $0.65 per 1M output tokens. |
| Returns | text, json |
| Runs | In the background |
| Setup | About 2 minutes, no API key |

## Prompts to try with Ternary Bonsai 2 27B in Claude Code

- Use Ternary Bonsai 2 27B to investigate the failing test in this project. Trace the relevant functions, propose the smallest fix, and run the focused test after editing.
- Use Ternary Bonsai 2 27B to explain how this project's main request handler reaches the database. Cite file paths and function names, and flag anything the code does not establish.
- Use Ternary Bonsai 2 27B to review the current diff for boundary errors. Give one concrete failing input for each suspected bug before proposing a change.
- Use Ternary Bonsai 2 27B with medium reasoning effort to compare the README requirements with the implementation. Return a short list of mismatches with file references.
- Use Ternary Bonsai 2 27B to inspect the project's scheduling algorithm. Check its complexity, empty-input behavior, and tie handling, then propose focused regression tests.

## How to set up Ternary Bonsai 2 27B in Claude Code

Pick the way that suits you. Each takes about two minutes.

### Use Spiral's MCP server

1. **Add the hosted server**: This adds Spiral to the current project. Add `--scope user` to use it in every project.

```bash
claude mcp add --transport http spiral https://api.spiral.ai/mcp
```

2. **Sign in**: Start `claude`, type `/mcp`, choose spiral and Authenticate. Sign in to Spiral in the browser and click Authorize. No API key.

### Use the Spiral skill

1. **Send Claude Code this message**: Your agent reads Spiral's skill and sets itself up.

```
set up https://spiral.ai/SKILL.md
```

2. **Sign in or paste a key**: Approve Spiral in the browser, or give the agent a key from the console.

### Use the Spiral CLI

1. **Install and sign in**: Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

```bash
npx -y spiral-cli@latest init
```

### Call the Spiral API

1. **Create an API key**: In the console, under API keys.

2. **Run Ternary Bonsai 2 27B**: One request; the result comes back by polling or a webhook.

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "openrouter",
    "model": "prism-ml/ternary-bonsai-2-27b",
    "input": {
      "messages": [
        {
          "role": "system"
        }
      ]
    }
  }'
```

Then paste one of the prompts above: Claude Code finds Ternary Bonsai 2 27B on Spiral, shows the price and runs it.

Setup guide in the docs: https://spiral.ai/docs/quickstarts/claude-code

## Ternary Bonsai 2 27B tools and prices

- [PrismML: Ternary Bonsai 2 27B](https://spiral.ai/tools/openrouter/prism-ml/ternary-bonsai-2-27b) (OpenRouter): Up to $0.002667 per run at the default inputs. $0.0975 per 1M input tokens, $0.65 per 1M output tokens.

## Settings you can ask for

| Setting | Allowed values | Default | Description |
| --- | --- | --- | --- |
| seed |  | — |  |
| stop |  | — |  |
| tools |  | — |  |
| top_k | 0 to … | — |  |
| top_p | 0 to 1 | — |  |
| logprobs |  | — |  |

## What can you do with Ternary Bonsai 2 27B in Claude Code?

Ternary Bonsai 2 27B can help trace behavior across a repository and reason through proposed fixes. Give it the failure, relevant files, and a concrete acceptance check.

### Trace a bug across source files

Give Ternary Bonsai 2 27B the failing behavior and relevant source code. Ask it to trace the execution path, propose a small fix, and identify a regression check.

### Explain an unfamiliar repository

Ask Ternary Bonsai 2 27B to map an entry point through the relevant modules, citing the functions responsible for each step.

### Review an algorithm

Have Ternary Bonsai 2 27B examine code for boundary cases, explain its time complexity, and suggest inputs that could expose a defect.

### Check a mathematical solution

Supply a problem and a proposed solution to Ternary Bonsai 2 27B. Ask it to find the first incorrect step and check the corrected result against the original conditions.

### Compare lengthy specifications

Give Ternary Bonsai 2 27B the text of two specifications. Request changed requirements, conflicting statements, and short supporting passages.

### Answer questions from reference text

Provide Ternary Bonsai 2 27B with relevant documentation and a focused question. Require supporting passages and an explicit statement when the answer is absent.

### Prepare an incident review

Ask Ternary Bonsai 2 27B to compare a supplied event timeline with a runbook. Request contradictions, unresolved questions, and evidence for each proposed explanation.

## Overview

- [OpenRouter](https://spiral.ai/providers/openrouter)
- [All Claude Code guides](https://spiral.ai/integrations/claude-code)

## Ternary Bonsai 2 27B in other agents

- [Amp](https://spiral.ai/integrations/amp/ternary-bonsai-2-27b)
- [ChatGPT](https://spiral.ai/integrations/chatgpt/ternary-bonsai-2-27b)
- [Claude](https://spiral.ai/integrations/claude-desktop/ternary-bonsai-2-27b)
- [Cline](https://spiral.ai/integrations/cline/ternary-bonsai-2-27b)
- [Codex](https://spiral.ai/integrations/codex/ternary-bonsai-2-27b)
- [Cursor](https://spiral.ai/integrations/cursor/ternary-bonsai-2-27b)
- [Devin](https://spiral.ai/integrations/devin/ternary-bonsai-2-27b)
- [dots](https://spiral.ai/integrations/dots/ternary-bonsai-2-27b)
- [Factory Droid](https://spiral.ai/integrations/factory-droid/ternary-bonsai-2-27b)
- [Gemini](https://spiral.ai/integrations/gemini/ternary-bonsai-2-27b)
- [Gemini CLI](https://spiral.ai/integrations/gemini-cli/ternary-bonsai-2-27b)
- [Google Antigravity](https://spiral.ai/integrations/antigravity/ternary-bonsai-2-27b)
- [goose](https://spiral.ai/integrations/goose/ternary-bonsai-2-27b)
- [Grok](https://spiral.ai/integrations/grok/ternary-bonsai-2-27b)
- [Grok Build](https://spiral.ai/integrations/grok-build/ternary-bonsai-2-27b)
- [Hermes](https://spiral.ai/integrations/hermes/ternary-bonsai-2-27b)
- [Instinct](https://spiral.ai/integrations/instinct/ternary-bonsai-2-27b)
- [Manus](https://spiral.ai/integrations/manus/ternary-bonsai-2-27b)
- [Muse](https://spiral.ai/integrations/muse/ternary-bonsai-2-27b)
- [Muse Code](https://spiral.ai/integrations/muse-code/ternary-bonsai-2-27b)
- [n8n](https://spiral.ai/integrations/n8n/ternary-bonsai-2-27b)
- [Notion](https://spiral.ai/integrations/notion/ternary-bonsai-2-27b)
- [OpenClaw](https://spiral.ai/integrations/openclaw/ternary-bonsai-2-27b)
- [opencode](https://spiral.ai/integrations/opencode/ternary-bonsai-2-27b)
- [Perplexity](https://spiral.ai/integrations/perplexity/ternary-bonsai-2-27b)
- [Raycast](https://spiral.ai/integrations/raycast/ternary-bonsai-2-27b)
- [VS Code](https://spiral.ai/integrations/vscode/ternary-bonsai-2-27b)
- [Windsurf](https://spiral.ai/integrations/windsurf/ternary-bonsai-2-27b)
- [Zapier](https://spiral.ai/integrations/zapier/ternary-bonsai-2-27b)

## More Claude Code guides

- [Step 5 Preview](https://spiral.ai/integrations/claude-code/step-5-preview)
- [Ternary Bonsai 2 9B](https://spiral.ai/integrations/claude-code/ternary-bonsai-2-9b)
- [Step 3.7 Flash](https://spiral.ai/integrations/claude-code/step-3-7-flash)
- [UI-TARS 1.5 7B](https://spiral.ai/integrations/claude-code/ui-tars-1-5-7b)
- [Sonar Reasoning Pro](https://spiral.ai/integrations/claude-code/sonar-reasoning-pro)
- [UnslopNemo 12B](https://spiral.ai/integrations/claude-code/unslopnemo-12b)

## Questions about Ternary Bonsai 2 27B in Claude Code

**Can Claude Code use Ternary Bonsai 2 27B?**

Yes. Add Spiral to Claude Code as an MCP server, and Claude Code can find and run Ternary Bonsai 2 27B like any built-in tool.

**How much does Ternary Bonsai 2 27B cost in Claude Code?**

Up to $0.002667 per run at the default inputs. $0.0975 per 1M input tokens, $0.65 per 1M output tokens. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your Claude Code plan is separate.

**Do I need an OpenRouter account to use Ternary Bonsai 2 27B in Claude Code?**

No. Spiral runs Ternary Bonsai 2 27B on its own OpenRouter account. You sign in to Spiral once and never paste a key.

**How long does it take to set up Ternary Bonsai 2 27B in Claude Code?**

About two minutes: add the hosted server, then sign in.

**Does Claude Code wait while Ternary Bonsai 2 27B runs?**

Ternary Bonsai 2 27B runs in the background. Claude Code starts the run, checks on it and gives you the text, json when it's ready.

**What is Ternary Bonsai 2 27B useful for?**

Start with code debugging, math problems, or questions that require comparing several passages of text. PrismML highlights math and coding performance close to the full-precision baseline and lists long-document analysis as an intended use.

**How much context does Ternary Bonsai 2 27B support?**

PrismML documents a 262K-token context window. For document questions, ask for supporting passages alongside the answer so you can check the result.

**How does it compare with Ternary Bonsai 27B?**

PrismML reports that Ternary Bonsai 2 27B retains over 98% of its full-precision baseline's aggregate benchmark performance, versus 95% for Ternary Bonsai 27B. These are maker-reported benchmark results, so test the tasks you intend to run.

**Which sampling settings should I start with?**

For reasoning generation, PrismML recommends temperature 1.0, top-p 0.95, and top-k 20. Use those as a starting point and compare results on your own examples.

**How can I get shorter responses?**

PrismML recommends medium reasoning effort for shorter responses; the model defaults to xhigh. Also specify the length and format you want for the final answer.

