1. API Key Generation
Log in to or create an account at https://r2copilot.ai.
Navigate to your profile page to view your active R2 subscriptions.
Access https://chat.r2copilot.ai to generate a new API key:
Select your profile icon located in the bottom-left corner.
Navigate to Settings > Developer API.
Select the desired subscription, enter a name for your key, and click Add Key.
Copy and store your API key in a secure location. Ensure it is kept confidential and never exposed publicly.
Your API key is ready. You can now use the R2 Custom API.
2. Chat Completions API Setup
Visual Studio Code (GitHub Copilot Chat)
In the chat panel, open the model selector located at the bottom:
Select Manage Models... from the menu:
Select Custom Endpoint, specify a name for the endpoint, paste your generated API key, and select Chat Completions API:
Open the generated
models_config.json file to view your custom endpoint configuration.Define the models you intend to use with this configuration (save the file upon editing):
Copy
{
"id": "<model_id>",
"name": "<custom_model_name>",
"url": "https://api-chat.r2copilot.ai/v1/chat/completions",
"apiType": "chat-completions",
"streaming": false,
"toolCalling": true,
"vision": false,
"maxInputTokens": 96000,
"maxOutputTokens": 4096
}To use the configured model, return to the model selection menu from Step 1, click Other Models, and select your newly created model.
Visual Studio Code (Continue Extension)
The R2 Chat Endpoint is compatible with the Continue extension for Visual Studio Code.
In the Continue chat interface, select Main Config in the bottom-right corner and click the gear icon:
In the opened
config.yaml file, add the model settings as shown below (save changes when finished):Copy
- name: "<custom_model_name>"
provider: openai
model: <model_id>
useResponsesApi: false
apiBase: https://api-chat.r2copilot.ai/v1
apiKey: <api_key>
roles:
- chat
defaultCompletionOptions:
maxTokens: 4096Select your configured model from the model selector in the chat window:
3. Responses API Setup
Visual Studio Code (GitHub Copilot Chat)
In the chat panel, open the model selector located at the bottom:
Select Manage Models... from the menu:
Select Custom Endpoint, specify a name for the endpoint, paste your API key, and select Responses API:
Open the generated
models_config.json file to verify endpoint creation. Add the target models using the following template format (save changes):Copy
{
"id": "<model_id>",
"name": "<custom_model_name>",
"url": "https://api-chat.r2copilot.ai/openai/responses",
"apiType": "responses",
"streaming": true,
"toolCalling": true,
"requestHeaders": {
"api-key": "<api-key>"
},
"vision": false,
"maxInputTokens": 96000,
"maxOutputTokens": 4096
}To use the model, navigate to Other Models in the model selection menu and choose your endpoint.
Visual Studio Code (Continue Extension)
The R2 Response API Endpoint is fully compatible with the Continue extension for Visual Studio Code.
In the Continue chat interface, select Main Config in the bottom-right corner and click the gear icon:
In the opened
config.yaml file, add the model configuration (save changes when finished):Copy
- name: "<custom_model_name>"
provider: openai
model: <model_id>
useResponsesApi: true
apiBase: https://api-chat.r2copilot.ai/openai
apiKey: <api_key>
roles:
- chat
defaultCompletionOptions:
maxTokens: 4096Select your model from the chat window selection dropdown:
Codex Desktop Application
The R2 Response API Endpoint is fully compatible with the Codex desktop application.
Locate the installation directory of the Codex application. The default path is
C:\Users\<your_user>\.codex. If this is an initial setup, log in or create an OpenAI account to complete the standard initialization. If you have existing settings, create backup copies of config.toml and models_cache.json before proceeding.Close the Codex application and exit completely from the system tray:
Open the
config.toml file located in the application folder using a text editor.At the top of the file, add or update the following configuration settings (overwrite existing
model, model_provider, or model_reasoning_effort entries as needed):Copy
model_provider = "r2_copilot"
model_reasoning_effort = "high"
model = "gpt-5.6-sol"Copy
[model_providers.r2_copilot]
name = "R2 Copilot"
base_url = "https://api-chat.r2copilot.ai/openai"
wire_api = "responses"
http_headers = { "api-key" = "<api-key>" }Launch the Codex application. Verify that R2 Copilot appears as the active model provider in the lower-left corner: