Skip to content
View as Markdown

Integrations

Anything with an OpenAI-compatible or Anthropic-compatible client can call Kiln: set the base URL to https://api.bricksum.com/v1 and pass your sk-bk- key. One page per SDK below, each with a snippet that has been run against the API, then the coding tools.

Note
On qwen3-32b, structured outputs (response_format) are not available. On qwen3-32b (measured 2026-09-26), forced tool choice fails without a clear error: tool_choice "required" returns HTTP 500 with a plain-text "Internal Server Error" body, and naming a function returns 200 with empty arguments (finish_reason "stop"). Neither is a 4xx, so do not retry it — send tool_choice "auto" only. On qwen3-32b the parallel_tool_calls setting is not applied, which is not the same as replies holding one call: even with parallel_tool_calls: false, one reply can carry several tool calls. Answer every entry in tool_calls with its own tool message. Give every tool a description: on gpt-oss-120b, where it was measured, a tool without one is rejected with 400. The model thinks before it answers (thinking mode) and those tokens count against max_tokens, so leave room for both. The SDK examples send 800, a starting value not measured on this model — if content comes back empty with finish_reason "length", raise it. Other models differ; see Models.

SDKs

Each page is short on purpose: what to install, one call that has been run against the API, and the two or three things that differ on Kiln. Everything the SDKs share is on the API reference instead of on five pages at once.

Coding tools

Claude Code, Codex CLI, Hermes Agent, OpenCode, OpenClaw and Cursor each connect with a short config change. The snippets are on this page; after you sign in, Console → Tools shows the same snippets. The agent modes of these tools rely on the automatic tool choice described above.

Note
Kiln serves the Chat Completions API, the Responses API and the Anthropic Messages API. Codex CLI connects over the Responses API and Claude Code over the Messages API, without a router in between; Hermes Agent and OpenClaw use a custom OpenAI-compatible provider. qwen3-32b has a 32,768-token context window, and an agent's system prompt and tool definitions take a large share of it before your first message; the Claude Code, Codex CLI, OpenCode, and OpenClaw configs below state that window so the tool compacts in time; OpenCode reserves 8,192 of it for the reply and compacts at 24,576; every token added to limit.output comes out of that prompt window. If replies stop with finish_reason "length", raise limit.output, but keep it at or below 16,384, which still leaves 16,384 for the prompt. Keep the key in an environment variable or secret manager, never in a committed file. Verify a short prompt first, then check the request in Console → Usage.

Claude Code

Claude Code speaks the Anthropic Messages API, which Kiln serves directly, so you need no router. Set ANTHROPIC_BASE_URL to the Kiln API origin, put your Kiln key in ANTHROPIC_AUTH_TOKEN, and point ANTHROPIC_MODEL and every ANTHROPIC_DEFAULT_*_MODEL slot at Kiln's model ID.

Endpoint reference: Messages API

Claude Code
# Claude Code connects to Kiln directly — Kiln serves the Anthropic Messages API.
# Put these in your shell profile (or a direnv file); never commit the key.
export ANTHROPIC_BASE_URL="https://api.bricksum.com"
export ANTHROPIC_AUTH_TOKEN="sk-bk-..."   # your Kiln API key

# Claude Code picks a model per task slot — point every slot at Kiln's model.
export ANTHROPIC_MODEL="qwen3-32b"
export ANTHROPIC_DEFAULT_OPUS_MODEL="qwen3-32b"
export ANTHROPIC_DEFAULT_SONNET_MODEL="qwen3-32b"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="qwen3-32b"

# Claude Code does not know this model, so it assumes a 200k context window and
# lets the session grow past what the upstream accepts. Tell it the real one —
# its own system prompt and tools take a large share of it, so it compacts early.
export CLAUDE_CODE_MAX_CONTEXT_TOKENS=32768

claude

Last checked against Claude Code's documentation on .

Codex CLI

Codex CLI reads this provider block from ~/.codex/config.toml and talks to Kiln over the Responses API (wire_api = "responses"). Set KILN_API_KEY in the shell before starting Codex, then keep the model ID aligned with Kiln's catalog.

~/.codex/config.toml
model = "qwen3-32b"
model_provider = "kiln"
# The model's real window; Codex's own prompt and tools take a large share of it.
model_context_window = 32768

[model_providers.kiln]
name = "Kiln"
base_url = "https://api.bricksum.com/v1"
env_key = "KILN_API_KEY"
# Codex speaks the Responses API (Kiln serves POST /v1/responses); "chat" is gone.
wire_api = "responses"
bash
# Set this in your shell profile, never commit it.
export KILN_API_KEY="sk-bk-..."

codex

Last checked against Codex CLI's documentation on .

Hermes Agent

Hermes Agent has a custom provider path for OpenAI-compatible endpoints. Save the endpoint and model in config.yaml and provide the key as OPENAI_API_KEY; Hermes keeps that endpoint configuration across sessions.

~/.hermes/config.yaml
model:
  provider: custom
  default: qwen3-32b
  base_url: https://api.bricksum.com/v1
bash
# Set this in your shell profile, never commit it.
export OPENAI_API_KEY="sk-bk-..."

# Start Hermes, then send a short test prompt.
hermes

Last checked against Hermes Agent's documentation on .

OpenCode

OpenCode uses the OpenAI-compatible provider package in opencode.json. The same provider configuration can be used from its terminal and desktop workflows.

opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "kiln": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Kiln",
      "options": {
        "baseURL": "https://api.bricksum.com/v1",
        "apiKey": "{env:KILN_API_KEY}"
      },
      "models": {
        "qwen3-32b": {
          "name": "qwen3-32b",
          "limit": { "context": 32768, "output": 8192 }
        }
      }
    }
  }
}
bash
# Set this in your shell profile, never commit it.
export KILN_API_KEY="sk-bk-..."

opencode

Last checked against OpenCode's documentation on .

OpenClaw

OpenClaw accepts custom providers under models.providers. Kiln uses the openai-completions adapter; declare the model once, then select it as kiln/qwen3-32b for the agent default.

~/.openclaw/openclaw.json
{
  "models": {
    "mode": "merge",
    "providers": {
      "kiln": {
        "baseUrl": "https://api.bricksum.com/v1",
        "apiKey": "${KILN_API_KEY}",
        "api": "openai-completions",
        "models": [
          {
            "id": "qwen3-32b",
            "name": "qwen3-32b",
            "contextWindow": 32768
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": { "model": { "primary": "kiln/qwen3-32b" } }
  }
}
bash
# Set this in your shell profile, never commit it.
export KILN_API_KEY="sk-bk-..."

Last checked against OpenClaw's documentation on .

Cursor

In Cursor Settings → Models, enter the Kiln key, enable Override OpenAI Base URL, then add and select the exact Kiln model ID.

Cursor
Cursor → Settings → Models

1. Paste your Kiln API key (sk-bk-...) into "OpenAI API Key"
2. Enable "Override OpenAI Base URL"
   → https://api.bricksum.com/v1
3. Add qwen3-32b to the model list and select it

Last checked against Cursor's documentation on .

Cookbook

End-to-end recipes that put these integrations to work, such as a streaming chat CLI, are in the Cookbook →