How to use Kilocode LLM API Directly
Recently, I was playing around with Kilocode which is an AI agent coding extension that you can install in VS Code (and forks like Cursor, Windsurf, etc)
While checking the code base for Kilocode provider it seems like they’re using OpenRouter under the hood.
So essentially, you can directly invoke API endpoint like how you would use OpenRouter API
Replace https://openrouter.ai/api/v1
in OpenRouter API endpoint with https://kilocode.ai/api/openrouter
and pass your API key in the header.
curl --location 'https://kilocode.ai/api/openrouter/chat/completions' \
--header 'Content-Type: application/json' \
--header 'Authorization: $KILOCODE_API_KEY' \
--data '{
"model": "google/gemini-2.5-flash-preview-05-20",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Hello"
}
]
}
]
}'
How to get KiloCode API Key?
You can get the KiloCode API from your dashboard.
Happy AI inference!
Was this content helpful?
Help us improve by giving us your feedback.