Repository navigation
Kilo Code custom OpenAI-compatible provider: VS Code dialog, kilo.json and limits #15441
apigoto
started this conversation in
4. Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I work on the APIGOTO team. APIGOTO is an independent OpenAI-compatible gateway, not affiliated with OpenAI, Anthropic or Google. The steps work for any OpenAI-compatible endpoint.
0. Check the endpoint
curl https://api.china-aiapi.com/v1/models -H "Authorization: Bearer $APIGOTO_API_KEY"VS Code extension
apigoto. Display name: anything you like.https://api.china-aiapi.com/v1. API key: your key./models. Pick from that list or typeMODEL_IDyourself. Fetch models retries after a fix.The dialog doesn't set token limits. Those go in the config file:
CLI /
kilo.json(~/.config/kilo/kilo.jsonor./kilo.json){ "provider": { "apigoto": { "npm": "@ai-sdk/openai-compatible", "env": ["APIGOTO_API_KEY"], "models": { "MODEL_ID": { "name": "My model", "limit": { "context": CONTEXT_TOKENS, "output": OUTPUT_TOKENS } } }, "options": { "baseURL": "https://api.china-aiapi.com/v1" } } }, "model": "apigoto/MODEL_ID" }npm:@ai-sdk/openai-compatible= Chat Completions.@ai-sdk/openai= Responses,@ai-sdk/anthropic= Messages.envreads the key from an environment variable instead of the file.limit: replace both placeholders with the model's real numbers. If omitted they default to0, which limits context management.Troubleshooting
/modelsunder the Base URL. Otherwise, enter IDs by hand.limitis missing (0) or wrong.options.kiloOpenAICompatibleToolCallContent: "empty-string"for endpoints that need""instead ofnullcontent. Only use it if you hit that error.Our gateway gives one key for several model families, with upstream failover (at most 3 retries) and per-request logs. Pay-as-you-go, BYOK supported: www.china-aiapi.com
Do you set
limitper model by hand, or have you found a cleaner way?All reactions