OpenCode / custom provider integration
api.aicu.ai is OpenAI-compatible. Swap the base URL and the key, and any OpenAI-compatible coding tool — OpenCode, Cline, Continue — can use
kimi-k2.7-code(tuned for coding) or the OpenAI models as-is.
✅ Verified — We ran Kimi-K2.7-Code (Powered by Sakura AI Engine,
kimi-k2.7-code) from OpenCode v1.18.9 through api.aicu.ai and confirmed code generation works end to end (2026-07-29).
Connection details
| Item | Value |
|---|---|
| Base URL | https://api.aicu.ai/v1 |
| API key | aicu_live_xxx (issue one in the dashboard — required) |
| Recommended models | kimi-k2.7-code (coding), gpt-4o-mini, gpt-5.4-mini |
Authentication is Bearer-based. The OpenAI SDK and these tools attach
Authorization: Bearer <API key>for you, so always fill in the API key field — leaving it empty gets you a 401.
OpenCode (opencode.json)
OpenCode can add custom providers through the AI SDK's @ai-sdk/openai-compatible. Add AICU to the opencode.json at your project root (or in ~/.config/opencode/).
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"aicu": {
"npm": "@ai-sdk/openai-compatible",
"name": "AICU API",
"options": {
"baseURL": "https://api.aicu.ai/v1",
"apiKey": "{env:AICU_API_KEY}"
},
"models": {
"kimi-k2.7-code": { "name": "Kimi-K2.7-Code (SAKURA)" },
"gpt-4o-mini": { "name": "GPT-4o mini" },
"gpt-5.4-mini": { "name": "GPT-5.4 mini" }
}
}
}
}
Registering the key is easiest from the TUI. Run /connect, pick Other at the bottom of the list, enter aicu as the provider ID, then paste your API key (aicu_live_...).
$ opencode
> /connect # Other → id: aicu → paste the API key
> /models # aicu/kimi-k2.7-code and friends show up as options
If you use {env:AICU_API_KEY}, you can pass the key via the environment instead.
export AICU_API_KEY=aicu_live_xxx
opencode
Model IDs must match the
idvalues returned byGET /v1/chat/models. You can check the current list any time withcurl https://api.aicu.ai/v1/chat/models. For the full set of configuration options, see the OpenCode docs on custom providers.
Enabling image input (multimodal)
kimi-k2.7-code is multimodal, but through OpenCode's @ai-sdk/openai-compatible the model's capabilities can't be discovered automatically, so image input is disabled by default. Attaching an image gets you an error like this model does not support image input.
To use image input, declare modalities explicitly on each model.
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"aicu": {
"npm": "@ai-sdk/openai-compatible",
"name": "AICU API",
"options": {
"baseURL": "https://api.aicu.ai/v1",
"apiKey": "{env:AICU_API_KEY}"
},
"models": {
"kimi-k2.7-code": {
"name": "Kimi-K2.7-Code (SAKURA)",
"modalities": {
"input": ["text", "image"],
"output": ["text"]
}
},
"sakura-kimi": {
"name": "Sakura Kimi (Kimi-K2.6)",
"modalities": {
"input": ["text", "image"],
"output": ["text"]
}
},
"gpt-4o-mini": { "name": "GPT-4o mini" },
"gpt-5.4-mini": { "name": "GPT-5.4 mini" }
}
}
}
}
Once modalities.input includes image, OpenCode's read tool can open image files and you can attach images in chat. For output, only text is practical today.
Why this is needed: the AICU API model list (
GET /v1/chat/models) says "multimodal" in thedescription, but doesn't return a machine-readablemodalities/capabilitiesstructure, so OpenCode errs on the safe side and assumes no image support. Once AICU API addsmodalitiesto the model list, image input will work without per-user configuration.
Desktop app (custom provider settings)
In a "configure an OpenAI-compatible provider" UI, fill in the following.
| Setting | Value |
|---|---|
| Provider ID | aicu (lowercase letters, digits, hyphens, underscores) |
| Display name | AICU API |
| Base URL | https://api.aicu.ai/v1 |
| API key | aicu_live_xxx (required — don't leave it empty) |
| Model ID | kimi-k2.7-code |
| Model name | Kimi-K2.7-Code |
| Headers (optional) | Not needed (Authorization is added automatically) |
When the UI says "you can leave the API key blank", that's for the case where you manage request headers yourself. api.aicu.ai uses Bearer authentication, so put your key in this field.
Cline
Cline is driven by tool calling, so a few settings matter more than they do elsewhere.
| Setting | Value | Why |
|---|---|---|
| Provider | OpenAI Compatible | api.aicu.ai is OpenAI-compatible |
| Base URL | https://api.aicu.ai/v1 | |
| API key | aicu_live_xxx | Required. An empty field gets you a 401 |
| Model ID | gpt-5.6-sol, gpt-5.6-terra, kimi-k2.7-code… | Current list: GET /v1/chat/models |
| Context window | 128K for the gpt-5.6 family | max_tokens in the model list tells you |
| Images | Yes | The gpt-5.6 family reads images (measured 2026-09-22) |
| Prompt caching | No | Not supported. Leaving it on makes Cline assume a discount it will not get, and Cline keeps stacking context |
Reasoning models and tool calling
gpt-5.6-sol / terra / luna and gpt-6-astra are reasoning models
(reasoning: true in GET /v1/chat/models). Upstream, reasoning and tool calling cannot both
be active in one request — and Cline always uses tool calling.
api.aicu.ai absorbs this for you. When a request carries tools, the gateway drops the
reasoning effort, so the call succeeds and you get your tool call back. Measured on 2026-09-22
with gpt-5.6-sol:
| Request | Result |
|---|---|
tools only | 200, tool call returned |
reasoning_effort: high only | 200, no tool call (nothing to call) |
tools and reasoning_effort: high | 200, tool call returned |
So you do not have to avoid reasoning_effort in Cline. What you should know is that
when tools are in play you are not paying for, or getting, deep reasoning — the depth you
asked for is quietly set aside in favour of the tool call. If you want the model to think hard,
ask it in a turn that has no tools attached.
Which model
| Model | Good at | Images | Note |
|---|---|---|---|
kimi-k2.7-code | Coding, inference inside Japan | Preview | Public preview on Sakura AI Engine. 8K output cap |
gpt-5.6-luna | Chat, summarising | ✅ | Lightest of the family |
gpt-5.6-terra | Everyday coding | ✅ | Half the price of sol |
gpt-5.6-sol | Hard reasoning, long context | ✅ | Top of the 5.6 family |
gpt-6-astra | Hardest reasoning | ✅ | Above sol, and priced accordingly |
Rates change; GET /v1/chat/models carries the current pricing for every model.
Rough pricing
kimi-k2.7-code: free during the alpha/preview period (Kumamoto earthquake relief, through 2026-10-31). Planned rate after GA: 11 AP input / 101 AP output per 1K tokens.- OpenAI models (
gpt-4o-miniand others) are also not billed during alpha. For rates, see the LLM API pricing table.
- Official docs: https://opencode.ai/docs/providers/#custom-provider
- Model list:
GET /v1/chat/models - Contact: https://aicu.ai/contact
© 2026 AICU Inc.