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

# Before you connect a tool

> Create an API key for the tool, choose a model, and save your key as an environment variable that every integration guide uses.

Every integration needs the same three values: an API key, the base URL, and a model alias. Set them up once as described on this page, then follow the guide for your tool.

Before you start, sign in to the [console](https://console.sinarcloud.com). AI requests are paid from your prepaid rupiah balance, so check that you have balance or [token credits](https://docs.sinarcloud.com/ai/token-credits.md) for the model you plan to use. To see your balance, click **Billing** under **Account** in the console sidebar. The **Current Credits** card shows it. To add balance, see [Add balance](https://docs.sinarcloud.com/billing/top-up.md).

**1. Create an API key for the tool**

1. In the console sidebar, under **AI**, click **API keys**. The **API Keys** page opens.
2. Click **Create API key**. You'll find the button next to **API endpoint** at the top of the page and in the **Your API keys** section. Both open the same dialog.
3. In **Key name**, name the key after the tool and the computer that uses it, for example `Claude Code - laptop`. You can rename the key later.
4. To make the key stop working at a set time, fill in **Expires at (optional)**. The field uses the time zone shown under it, which you can change in [Account settings](https://docs.sinarcloud.com/account/settings.md). Leave the field empty for a key that never expires.
5. Click **Create key**.
6. The dialog changes to **Your key is ready** and shows your key under **New secret key**. Click **Copy secret**, then click **Done**. If you close the dialog first, you can still copy the key later with **Copy** in the **Your API keys** list.

![Create an API key dialog open over the API Keys page, with a Key name field, an Expires at (optional) date and time field with the time zone shown under it, and Cancel and Create key buttons](https://mintcdn.com/sinar-cloud/ShOrAB8ikH3IKe3Y/images/ai-api-key-create.png?fit=max\&auto=format\&n=ShOrAB8ikH3IKe3Y\&q=85\&s=5856c63de285ff4a1b440fae4c588b91)

Name the key after the tool that uses it

A separate key for each tool lets you see what each tool spends, because the **Usage** page can filter by API key. If one key leaks, you can revoke it without breaking your other tools.

> [!WARNING]
>
> Keep your API key private. Anyone who has it can make API requests using your account. Don't put the key in files that you commit to a repository. The guides read it from an environment variable instead. If a key leaks, click **Revoke** next to it, then click **Revoke key** to confirm.

**2. Note the base URL**

The base URL is the address a tool sends its requests to. The one you enter depends on the request format the tool uses:

| Tool | Request format | Base URL |
| - | - | - |
| Claude Code, in the terminal or in VS Code | Anthropic Messages | `https://ai.sinarcloud.com` |
| OpenCode, Cline, Kilo Code, Continue, and the OpenAI SDKs | OpenAI | `https://ai.sinarcloud.com/v1` |

Each guide shows the exact value to enter.

The console shows the OpenAI base URL too. At the top of the **API Keys** page, the **API endpoint** box shows the full chat completions endpoint, `https://ai.sinarcloud.com/v1/chat/completions`. The hint under the box gives the base URL, `https://ai.sinarcloud.com/v1`.

![API Keys page with the quick start at the top: the API endpoint box showing https://ai.sinarcloud.com/v1/chat/completions with a copy icon and a Create API key button, the hint that gives https://ai.sinarcloud.com/v1 as the base URL, and a Quick start (cURL) sample request for deepseek/deepseek-v4-1-flash with its own copy icon. The Your API keys list starts below it.](https://mintcdn.com/sinar-cloud/ShOrAB8ikH3IKe3Y/images/ai-api-keys.png?fit=max\&auto=format\&n=ShOrAB8ikH3IKe3Y\&q=85\&s=120f522a148d183a67e641d660a89697)

The base URL is in the hint under API endpoint

> [!NOTE]
>
> Don't paste the full endpoint from the **API endpoint** box into a tool's base URL field. Tools add `/chat/completions` to the base URL themselves, so their requests would go to the wrong address.

**3. Choose a model**

1. Under **AI**, click **Models**. The table shows each model's price per 1M input and output tokens and its context window.
2. To find a model, type its name, alias, or publisher in the search box above the table, for example `deepseek`. To show chat models only, click **Text** under the search box.
3. Click **Details** on the model's row. The model's details open in a dialog.

![The Models page with Clear filters and Refresh at the top right and the search box below them, with deepseek entered. Under the search box, the All and Text mode buttons with counts sit above a table of DeepSeek models, one marked with the Popular sparkle icon and some tagged ZDR. The table has Model, Input, Output, Cache read, Cache write, and Context columns and a Details button on each row.](https://mintcdn.com/sinar-cloud/Zz311Jgf5s_A88RD/images/ai-models.png?fit=max\&auto=format\&n=Zz311Jgf5s_A88RD\&q=85\&s=62aacc42fd75bc459731e588f703775f)

Search for a model, then click Details

To run a coding agent, the **Model capabilities** on the **Overview** tab must list:

* **Chat completions**, because both request formats run on it.
* **Tool use**, because agents call tools to read files, edit code, and run commands.
* **Streaming**, because agents show the reply while the model writes it.

To let a tool send images, such as screenshots, the model must also list **Image input** or **Vision**. Above the tabs, the details also show the model's **Context window (tokens)** and **Maximum output (tokens)**. Some tools ask you for these numbers.

Below the model name is the model alias, such as `deepseek/deepseek-v4-1-flash`. Click the copy icon next to it (**Copy model ID**) to copy it. The guides use `deepseek/deepseek-v4-1-flash` in their examples. Replace it with the alias of the model you chose.

![The model details dialog for a DeepSeek model, showing its publisher, the Available, CHAT, and Popular badges, its alias with a copy icon, a button to get the model's API, and the Try in playground and Use via API buttons. Below are the prices per 1M tokens, with both cache write prices showing Not available, the context window and maximum output, and the Overview tab open with Supported inputs, Model capabilities with a description of each, and Publish date.](https://mintcdn.com/sinar-cloud/ShOrAB8ikH3IKe3Y/images/ai-model-details.png?fit=max\&auto=format\&n=ShOrAB8ikH3IKe3Y\&q=85\&s=b884851a91e53793346bdf6f50ad95af)

Check the model capabilities, then copy the alias

Models tagged **ZDR** are zero data retention versions, which don't keep your prompts and responses after your request is complete. Each one has its own alias and prices. See [Models and pricing](https://docs.sinarcloud.com/ai/models.md).

**4. Save your API key as an environment variable**

The guides read your API key from the `SINARCLOUD_API_KEY` environment variable. Set it in the terminal where you will start the tool.

1. On the **API Keys** page, under **Your API keys**, click **Copy** next to your key.
2. In your terminal, run the command for your system. Replace `paste-your-api-key-here` with the key you copied, and keep the quotes.

![The end of the Quick start (cURL) sample, followed by the Your API keys list with the number of keys, Refresh and Create API key buttons, and Key, Status, Created, Last used and Actions columns. Each key shows its name, the first characters of the key followed by dots, the scopes api:read and api:write, No expiry, the Active status, and Copy, Rename and Revoke actions.](https://mintcdn.com/sinar-cloud/ShOrAB8ikH3IKe3Y/images/ai-api-keys-list.png?fit=max\&auto=format\&n=ShOrAB8ikH3IKe3Y\&q=85\&s=485f41be9c2f3561f06d7acf80adde1d)

Copy is next to each key under Your API keys

> [tab] macOS and Linux
>
> ```bash theme={null}
> export SINARCLOUD_API_KEY="paste-your-api-key-here"
> ```

> [tab] Windows PowerShell
>
> ```powershell theme={null}
> $env:SINARCLOUD_API_KEY = "paste-your-api-key-here"
> ```

**Copy** is turned off for expired and revoked keys. If an active key's row says **Create a new key to enable copying.**, the console can't show that key again. Create a new key and use it instead.

To check that the variable is set, run this in the same terminal. It prints `set` without showing your key. If it prints nothing, run the command above again.

> [tab] macOS and Linux
>
> ```bash theme={null}
> [ -n "$SINARCLOUD_API_KEY" ] && echo set
> ```

> [tab] Windows PowerShell
>
> ```powershell theme={null}
> if ($env:SINARCLOUD_API_KEY) { "set" }
> ```

This variable lasts until you close the terminal. To keep it for every new terminal:

> [tab] macOS and Linux
>
> Add the `export` line to your shell's startup file, then open a new terminal. On macOS, the file is usually `~/.zshrc`. On most Linux systems, it's `~/.bashrc`.

> [tab] Windows PowerShell
>
> Run this command once, then open a new terminal:
>
> ```powershell theme={null}
> [Environment]::SetEnvironmentVariable("SINARCLOUD_API_KEY", "paste-your-api-key-here", "User")
> ```

Both ways store the key as plain text in your user account, so only do this on a computer that only you use.

## Keep an eye on spending

Coding agents send the conversation so far, including the files they've read, with every request. A long session can use millions of tokens.

* **Check each tool's spending.** Under **AI**, click **Usage**, then choose the tool's key in the **API key** filter. See [Usage and spending](https://docs.sinarcloud.com/ai/usage.md).
* **Start a new session for each new task.** A new session doesn't resend the earlier conversation.
* **Compare prices before you choose a model.** The **Models** page shows each model's price per 1M input and output tokens.
* **Use token credits.** [Token credits](https://docs.sinarcloud.com/ai/token-credits.md) for a model pay for its requests before your balance is charged.

SinarCloud charges each request after it finishes, so a long agent session can take your balance below zero. A request starts only while your balance is above Rp 0, you have token credits left for the model, or the request can't cost you anything. To keep working, [add balance](https://docs.sinarcloud.com/billing/top-up.md).

## Next steps

> [card] [Claude Code](https://docs.sinarcloud.com/integrations/claude-code.md)
>
> Connect Anthropic's coding agent for the terminal.

> [card] [OpenCode](https://docs.sinarcloud.com/integrations/opencode.md)
>
> Connect the open source coding agent for the terminal.

> [card] [VS Code](https://docs.sinarcloud.com/integrations/vscode.md)
>
> Connect a coding agent in VS Code: Claude Code, Cline, Kilo Code, or Continue.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.