Want to use your own AI model for coding without a complicated setup? Droid makes that easier by supporting external APIs in its CLI, so you can connect a custom model that fits your workflow. This guide shows you how to set up the API, fix common issues, and use Kimi in Droid. Keep reading to get started.
What is Droid?
Droid is an AI coding tool that helps developers write code, solve errors, and handle development tasks more efficiently. It supports built-in AI models and also lets users connect custom models through its CLI for more flexibility. This makes it useful for different coding workflows, whether you need quick help or a more personalized setup.
How to use built-in AI models in Droid?
Built-in AI models make it easy to start coding with Droid because you do not need to connect to any external API first. Once the app is installed, you can pick a model inside the platform and begin using AI help for code analysis, feature work, bug fixes, and reviews. Here's how to get started with Droid:
Step 1: Install and open Droid
Start by downloading the Factory App on your device and completing the installation. After that, open the app and sign in to your account. This gives you access to Droid and its built-in AI features inside the app.
Step 2: Connect Droid to your project folder
Set your working directory to the codebase you want to work on. This links Droid with your local project so it can read the files, understand the code structure, and support your development tasks with better context.
Step 3: Choose a built-in model and start prompting
Open the model selector and pick one of the built-in AI models available in Droid. Once the model is selected, you can start giving prompts such as asking it to analyze the codebase, fix a bug, review code, or build a feature.
How to connect Droid with an external API?
Connecting Droid to an external API gives you more freedom to work with the model you prefer instead of staying limited to built-in options. The setup happens inside the Droid CLI by adding a custom model to the settings file, and once it is saved, the model becomes available from the /model menu. The steps below use Kimi as a simple example, so you can see how the full setup works from API key to model selection:
Step 1: Get a Kimi API key from Moonshot AI
Start by creating or copying yourKimi API key from Moonshot AI. You will need this key because Droid uses it to connect with the Kimi API and send requests through your own account. It is best to save the key as an environment variable such as MOONSHOT_API_KEY so it can be used safely inside the settings file.
Step 2: Open the Droid settings file
Next, open the settings file where custom models are added in Droid CLI. On macOS, the file path is ~/.factory/settings.json. On Windows PowerShell, use %USERPROFILE%\.factory\settings.json. This is the main file where Droid reads your custom model configuration.
Step 3: Add Kimi as a custom model
Inside settings.json, add Kimi under the customModels array. This tells Droid which model to use, which API endpoint it should call, which provider format it follows, and which API key should be used for authentication. If the file already has other settings, do not replace everything, just add this model object inside the existing customModels array.
Step 4: Save the file and restart Droid
After adding the configuration, save the file and restart Droid CLI. This makes sure Droid reloads the updated settings and recognises the newly added custom model properly.
Step 5: Select the Kimi model using /model inside Droid
Open Droid CLI and run the /model command. Your Kimi setup should now appear in the Custom models section. Select it from the list to make Kimi the active model for your coding session.
Step 6: Run a task
Once Kimi is selected, you can start using it for real work in Droid. Try a prompt like reviewing code, fixing a bug, or explaining a codebase. Droid will send the request through the Kimi API and use that model for the task.
Benefits of using the Kimi API
After connecting Kimi to Droid, it becomes much more than just an external model in the CLI. It turns into a practical coding assistant that fits into your daily development workflow and helps with both small coding jobs and larger engineering tasks. Here are some benefits of using Kimi API:
Boost development efficiency
Kimi can help you move through everyday coding tasks more quickly by generating code, explaining logic, and suggesting fixes while you work. This means you do not need to switch between multiple tools for simple development support. With Kimi inside Droid, routine programming work becomes faster to manage.
Write more reliable code
Kimi can review your code, point out possible issues, and help improve the structure before small mistakes turn into bigger problems. This kind of early feedback is useful when you want cleaner logic and better maintainability. Over time, it can help you build code that is easier to test, update, and understand.
Handle diverse development tasks
Kimi is not limited to writing code from scratch. It can also help with refactoring, documenting code, understanding unfamiliar projects, and supporting feature development across different tasks. This makes it a flexible option for developers who want one AI model to assist with many parts of the workflow.
Troubleshooting common errors for connecting APIs
Connecting an external API key in Droid is usually straightforward, but small setup mistakes can still cause problems. Most issues come from the settings file, provider name, API key, or model server configuration rather than Droid itself. The good part is that these errors are often easy to fix once you know where to look.
Model not appearing in selector
Check JSON syntax in
~/.factory/settings.jsonorconfig.jsonif you are using the legacy formatSettings changes are detected automatically through file watching
Verify that all required fields are present in the custom model configuration
"Invalid provider" error
Make sure the provider value is exactly
anthropic,openai, orgeneric-chat-completion-apiCheck for spelling mistakes and correct capitalisation in the provider field
Authentication errors
Verify that your API key is valid and has available credits
Check that the API key has the correct permissions for the provider
Confirm that the base URL matches the API endpoint in the provider’s documentation
Local model won’t connect
Make sure your local model server is running, such as
ollama serveVerify that the base URL is correct and includes
/v1/if the provider requires itCheck that the model has already been pulled or is available locally
Rate limiting or quota errors
Check your provider’s API rate limits and usage quotas
Monitor your usage from the provider dashboard to see whether limits have been reached
Conclusion
Using custom APIs in Droid gives you more control over how you build, test, and improve code with AI. Once the setup is in place, it becomes easier to shape your coding workflow around the model that fits your needs. Whether you stay with built-in options or connect an external model, Droid gives you a flexible way to bring AI into development. If you want a simple place to start with a custom setup, Kimi is worth trying in Droid. It can be a practical choice for making everyday coding work smoother and faster.