API Key Documentation for Coding Tools
Configure your API key and base URL for popular command-line and IDE tools
Speed
Measured through our public API, the way your tool calls it: streaming, a fresh prompt each time (no cache hits), up to 512 output tokens.
Gemma 4 26B (google/gemma-4-26B-A4B-it)
| 1 request at a time | 4 requests at once | |
|---|---|---|
| Output speed per request | ~100 tokens/s | ~85 tokens/s |
| Time to first token (~1K-token prompt) | ~2–3 s | ~2 s |
- A ~6K-token prompt still starts answering in about 3 s, then streams at ~80 tokens/s.
- For a typical coding-agent turn, a 500-token reply streams in about 5 seconds.
Gemma 4 31B (google/gemma-4-31B-it) is our larger dense model. It starts just as fast (~2 s) but writes at about 15 tokens/s. Use it when you want its quality, and 26B when speed matters.
Measured October 2026. Real speed varies with load and prompt length.
OpenCode
OpenCode is an open-source coding agent for the terminal. Add RainDragon as a custom provider in opencode.json (in your project, or ~/.config/opencode/opencode.json for every project).
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"raindragon": {
"npm": "@ai-sdk/openai-compatible",
"name": "RainDragon",
"options": {
"baseURL": "https://inference.raindragon.ai/v1",
"apiKey": "{env:RAINDRAGON_API_KEY}"
},
"models": {
"google/gemma-4-26B-A4B-it": {
"name": "Gemma 4 26B A4B",
"limit": { "context": 204800, "output": 32768 }
},
"google/gemma-4-31B-it": {
"name": "Gemma 4 31B",
"limit": { "context": 65536, "output": 16384 }
}
}
}
}
}Set your key, start OpenCode, and pick a RainDragon model with /models:
export RAINDRAGON_API_KEY="your-api-key" opencode
Instead of the environment variable you can run /connect, choose Other, enter the provider ID raindragon, and paste your key.
Hermes Agent
Hermes Agent by Nous Research works with any OpenAI-compatible endpoint. The quickest way is the setup wizard:
hermes model # choose "Custom endpoint", then enter: # API base URL: https://inference.raindragon.ai/v1 # API key: your-api-key # Model name: google/gemma-4-26B-A4B-it
Or set it directly in ~/.hermes/config.yaml:
model: default: google/gemma-4-26B-A4B-it provider: custom base_url: https://inference.raindragon.ai/v1 key_env: RAINDRAGON_API_KEY
and export the key in the shell that runs Hermes:
export RAINDRAGON_API_KEY="your-api-key"
Cline
Cline, a VS Code extension, allows you to configure API keys and custom base URLs directly within its settings.
- Open the Cline extension settings in VS Code.
- Select "OpenAI Compatible" from the API Provider dropdown.
- Enter your API key into the OpenAI API Key field:
API Key: your-api-key
- Check the "Use custom base URL" box and enter the base URL:
Base URL: https://inference.raindragon.ai/v1
OpenHands
OpenHands is an open-source AI agent that uses a web-based user interface for configuration.
- Launch the OpenHands application and navigate to the web UI, typically at http://localhost:3000.
- Go to the Settings page and find the LLM tab.
- Toggle Advanced options to reveal additional settings.
- In the Base URL field, specify:
Base URL: https://inference.raindragon.ai/v1
- Set your API key:
API Key: your-api-key
Aider Coder
Aider can connect to any LLM with an OpenAI-compatible API endpoint.
Environment Variables
You can set the base URL and API key using environment variables:
export OPENAI_API_BASE=https://inference.raindragon.ai/v1 export OPENAI_API_KEY="your-api-key"
YAML Config File
You can also add these settings to your .aider.conf.yml file:
openai-api-base: https://inference.raindragon.ai/v1 openai-api-key: "your-api-key"
Codex CLI
Codex CLI allows you to define custom providers in a configuration file.
- Create or edit the configuration file located at ~/.codex/config.toml.
- Define a new model provider block:
[model_providers.raindragon] name = "RainDragon AI" base_url = "https://inference.raindragon.ai/v1" env_key = "RAINDRAGON_API_KEY"
- Then, set the environment variable RAINDRAGON_API_KEY with your actual key:
export RAINDRAGON_API_KEY="your-api-key"
Claude Code
While Claude Code is optimized for Anthropic's models, it can be configured to use a custom base URL by editing a local configuration file.
- Create or edit the settings.json file in your .claude directory, typically located at ~/.claude/settings.json.
- Add the following env block to the file, replacing "your-api-key" with your actual key:
{
"env": {
"ANTHROPIC_BASE_URL": "https://inference.raindragon.ai/",
"ANTHROPIC_API_KEY": "your-api-key"
}
}Easy LLM CLI
Easy LLM CLI, a fork of the Gemini CLI, explicitly supports custom LLM providers through environment variables.
Set the following environment variables to configure your custom provider:
export USE_CUSTOM_LLM=true export CUSTOM_LLM_PROVIDER="openai" export CUSTOM_LLM_API_KEY="your-api-key" export CUSTOM_LLM_ENDPOINT="https://inference.raindragon.ai/v1" export CUSTOM_LLM_MODEL_NAME="google/gemma-4-26B-A4B-it"
Qwen Code
Qwen Code CLI, another fork of the Gemini CLI, also uses environment variables to configure an OpenAI-compatible API with a custom base URL.
Set the environment variables with your custom provider's details:
export OPENAI_API_KEY="your-api-key" export OPENAI_BASE_URL="https://inference.raindragon.ai/v1" export OPENAI_MODEL="google/gemma-4-26B-A4B-it"
Generate API keys in your dashboard under API Settings.
