> ## Documentation Index
> Fetch the complete documentation index at: https://doc.onetoken.one/llms.txt
> Use this file to discover all available pages before exploring further.

# Coder

## Complete Guide: Configuring OneToken API in Coder

By integrating Coder with the OneToken platform, you can easily access a variety of powerful Large Language Models (LLMs). Follow the detailed, step-by-step guide below to complete the configuration.

### 📝 Prerequisites

Before you begin, please ensure you have the following ready:

* Registered and logged into the [OneToken Platform](https://onetoken.one/).
* Accessed the [OneToken Console](https://onetoken.one/console/token) and generated your unique **API Key** (please keep this safe and secure).

***

### ⚙️ Configuration Steps

**1. Go to the Agent Settings**
Open the Coder interface and navigate to the dedicated Agent page. Find and click the "Settings" icon to enter the system's configuration backend.

<img src="https://mintcdn.com/onetoken-9a3c590a/qUcJ51oot29KEI_0/images/coder/0.png?fit=max&auto=format&n=qUcJ51oot29KEI_0&q=85&s=a0eb270ceebbe1429b5be095684d38c0" width="1286" height="952" data-path="images/coder/0.png" />

**2. Access the Manage Agent Menu**
In the settings navigation bar, click on the "Manage Agent" menu to prepare for API binding.

<img src="https://mintcdn.com/onetoken-9a3c590a/qUcJ51oot29KEI_0/images/coder/1.png?fit=max&auto=format&n=qUcJ51oot29KEI_0&q=85&s=42dcaf58fd8ff101c3eb32f608b5745f" width="1102" height="978" data-path="images/coder/1.png" />

**3. Select the Model Provider**
Click to enter the "Providers" page. From the list of officially supported providers, **please select OpenAI**.

> **💡 Tip:** Why select OpenAI when we are using OneToken?
> This is because OneToken provides an interface that is fully compatible with the standard OpenAI API format. By selecting the OpenAI provider and modifying the proxy address (BaseURL), we can seamlessly connect to OneToken's services.

<img src="https://mintcdn.com/onetoken-9a3c590a/qUcJ51oot29KEI_0/images/coder/2.png?fit=max&auto=format&n=qUcJ51oot29KEI_0&q=85&s=c25c99f0b75f3dc4c6ea55d3cf29cc64" width="782" height="1266" data-path="images/coder/2.png" />

<img src="https://mintcdn.com/onetoken-9a3c590a/qUcJ51oot29KEI_0/images/coder/3.png?fit=max&auto=format&n=qUcJ51oot29KEI_0&q=85&s=42d6da541eb535b4647125eaeec16bd8" width="2070" height="1438" data-path="images/coder/3.png" />

**4. Fill in the Core API Parameters**
This is the most crucial step. Please accurately fill in the following information in the configuration form:

* **BaseURL:** Enter `https://onetoken.one/v1`
* **API Key:** Enter the OneToken API Key you obtained during the prerequisites stage.

Once you have confirmed the information is correct, click the "Create" button to save your configuration.

<img src="https://mintcdn.com/onetoken-9a3c590a/qUcJ51oot29KEI_0/images/coder/4.png?fit=max&auto=format&n=qUcJ51oot29KEI_0&q=85&s=a8e8cdf7d1ed4df379647509d258fee4" width="1770" height="1330" data-path="images/coder/4.png" />

**5. Create and Bind Specific Models**
After configuring the provider, navigate to the "Models" page. Click to create a new model, manually input the name of the model you wish to use (e.g., `gpt-4o`, `claude-3-5-sonnet`, etc. Please refer to the OneToken platform for the supported model list), and link it to the provider you just created.

<img src="https://mintcdn.com/onetoken-9a3c590a/qUcJ51oot29KEI_0/images/coder/5.png?fit=max&auto=format&n=qUcJ51oot29KEI_0&q=85&s=f074627c45fe11025873febd79cc40b4" width="2920" height="1212" data-path="images/coder/5.png" />

**6. Chat Test and Usage**
Once all configurations are complete, return to Coder's main chat interface.
Send a simple test message (e.g., "Hello, testing the connection."). If the model responds normally and quickly, your configuration is successful, and you are ready to go!

<img src="https://mintcdn.com/onetoken-9a3c590a/qUcJ51oot29KEI_0/images/coder/6.png?fit=max&auto=format&n=qUcJ51oot29KEI_0&q=85&s=08dee62ce3a2fc7fe6011eaa88aba4f9" width="1738" height="1126" data-path="images/coder/6.png" />

***

### 🛠️ FAQ & Troubleshooting

If you encounter errors during the test in Step 6, please check the following:

* **Incorrect BaseURL Format:** Double-check your BaseURL and ensure there are no trailing slashes (Correct format: `https://onetoken.one/v1`).
* **Invalid API Key:** Ensure the API Key is copied completely without any accidental leading or trailing spaces.
* **Incorrect Model Name:** Make sure the model name you entered in Step 5 actually exists and is currently supported on the OneToken platform.
