Skip to main content

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​

ItemValue
Base URLhttps://api.aicu.ai/v1
API keyaicu_live_xxx (issue one in the dashboard — required)
Recommended modelskimi-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 id values returned by GET /v1/chat/models. You can check the current list any time with curl 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 the description, but doesn't return a machine-readable modalities / capabilities structure, so OpenCode errs on the safe side and assumes no image support. Once AICU API adds modalities to 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.

SettingValue
Provider IDaicu (lowercase letters, digits, hyphens, underscores)
Display nameAICU API
Base URLhttps://api.aicu.ai/v1
API keyaicu_live_xxx (required — don't leave it empty)
Model IDkimi-k2.7-code
Model nameKimi-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.

SettingValueWhy
ProviderOpenAI Compatibleapi.aicu.ai is OpenAI-compatible
Base URLhttps://api.aicu.ai/v1
API keyaicu_live_xxxRequired. An empty field gets you a 401
Model IDgpt-5.6-sol, gpt-5.6-terra, kimi-k2.7-code…Current list: GET /v1/chat/models
Context window128K for the gpt-5.6 familymax_tokens in the model list tells you
ImagesYesThe gpt-5.6 family reads images (measured 2026-09-22)
Prompt cachingNoNot 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:

RequestResult
tools only200, tool call returned
reasoning_effort: high only200, no tool call (nothing to call)
tools and reasoning_effort: high200, 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​

ModelGood atImagesNote
kimi-k2.7-codeCoding, inference inside JapanPreviewPublic preview on Sakura AI Engine. 8K output cap
gpt-5.6-lunaChat, summarising✅Lightest of the family
gpt-5.6-terraEveryday coding✅Half the price of sol
gpt-5.6-solHard reasoning, long context✅Top of the 5.6 family
gpt-6-astraHardest 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-mini and others) are also not billed during alpha. For rates, see the LLM API pricing table.

© 2026 AICU Inc.