Coding agent setup¶
Coding agents are the fastest way to get value out of Mango Inference without writing any client code: point the agent at a Mango Inference base URL, give it your API key and a model ID, and it works against your repository the way it would against its vendor's own API.
Prerequisites¶
- A Mango Inference API key.
- A model ID from your catalogue. See
Models and pricing. The examples here
use
zai-org/GLM-5.3.
Which agents work¶
Three have a verified, step-by-step guide in these docs:
| Agent | Endpoint it uses | How it is configured | Guide |
|---|---|---|---|
| Claude Code | /v1/messages |
Two environment variables | Claude Code |
| OpenCode | /v1/messages |
A provider entry in opencode.json |
OpenCode |
| OpenHands | /v1/messages |
config.toml (or the Settings UI) |
OpenHands |
- Claude Code: set
ANTHROPIC_BASE_URLandANTHROPIC_API_KEY, then point each model tier at a Mango Inference model ID. No config file to edit; see the snippet below. - OpenCode: declare Mango Inference as a custom
provider in
opencode.jsonusing the@ai-sdk/anthropicpackage, then select the model. The guide covers the config shape and how to select the model. - OpenHands: set the LLM's custom model, base
URL, and API key. The
anthropic/model prefix is what routes the request through OpenHands' Anthropic client.
Any other agent works too, as long as you can override its base URL. That is
the whole requirement: point the agent's base URL at https://api.mangoboost.io for
Claude Code (or https://api.mangoboost.io/v1 for OpenCode, OpenHands, and
OpenAI-shaped clients), give it your API key, and name a model from your
catalogue. Before you commit to one, check what
it needs beyond chat. See
OpenAI compatibility. Agents that need
endpoints beyond chat (embeddings for retrieval, the Responses or Assistants
APIs for agent state) will fail on those calls; Mango Inference serves none of
them.
Quick start: Claude Code¶
export ANTHROPIC_BASE_URL="https://api.mangoboost.io"
export ANTHROPIC_API_KEY="<your-api-key>"
export ANTHROPIC_DEFAULT_OPUS_MODEL="zai-org/GLM-5.3"
export ANTHROPIC_DEFAULT_SONNET_MODEL="zai-org/GLM-5.3"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="zai-org/GLM-5.3"
claude
Set all three model variables: Claude Code picks a tier per task, and a tier still pointing at an Anthropic model name fails once it is selected. Full walkthrough and caveats: Claude Code.
Claude Code takes the host without /v1; OpenCode and OpenHands need it
All three agents talk to the /v1/messages
endpoint. Claude Code appends /v1/messages itself, so its base URL is
https://api.mangoboost.io with no /v1 suffix. Adding it yourself
produces a 404 on /v1/v1/messages. OpenCode and OpenHands do not
append the path, so their base URL is https://api.mangoboost.io/v1.
Agents built on the OpenAI SDK also want https://api.mangoboost.io/v1.
What decides whether it works well¶
Two things, and neither is a setting:
- The model's tool-calling ability. An agent that cannot reliably call tools talks about editing files instead of editing them. Tool calling is a property of the model, not the platform. See Tool calling and check the model card before you commit to a model.
- The endpoints the agent expects beyond chat.
/v1/messages/count_tokensis served, so context and cost estimates that agents derive from it work normally. Prompt caching and extended thinking are Anthropic platform features rather than parts of the Messages request shape, and whether they take effect here is not verified. If they are not honoured, the cost is money and latency, not failure.