Skip to main content
An API Key is the credential that lets a client call 4096bytes. You need one before connecting Codex, Claude Code, Cursor, Cherry Studio, or another client manager. Create separate API Keys for different clients or devices. For example, use one key for Codex, one for Cursor, and one for Cherry Studio. This makes usage easier to trace and lets you disable only the affected key if a client leaks it.
An API Key is an account credential. If it is exposed, others may consume your balance. Delete leaked keys immediately and create a new one.

Open the API keys page

1

Sign in to the dashboard

Visit https://dash.4096bytes.com/login and sign in to your 4096bytes account.
2

Open API keys

In the left menu, open API Keys.
3

Review existing keys

The page lists keys created under the current account. You can refresh the list or create a new key.
API keys page If old keys already exist, do not reuse the same key everywhere. Prefer names such as claude-code-mac, codex-work, or cursor-desktop.

Create a key

Click Create key. The dashboard opens a dialog. At minimum, fill in Name and choose a Group. Keep other switches off unless you know you need the restriction. Create key dialog
1

Enter a name

Use a clear name such as macbook-codex, cursor-work, or cherry-studio-home.
2

Choose a group

Select the model route, plan, or group this key should use. Rates, available models, and quota rules may differ by group. Use what the dashboard shows.
3

Leave custom key off

Keep Custom key disabled unless you have a specific reason to fix the key string. Auto-generated keys are safer.
4

Enable IP restriction only when needed

Use IP restriction only for fixed servers or fixed outbound IPs. It is usually not suitable for laptops or mobile networks.
5

Set a quota limit if needed

Quota limit controls the maximum USD amount this key can consume. 0 means unlimited. Use a small limit for temporary projects, team members, or rarely used devices.
6

Set rate limits if needed

Enable Rate limit only when you need to reduce concurrency or prevent abnormal client usage.
7

Set an expiry if needed

Use Key validity period for temporary test keys. Long-term local tools can stay valid longer.
8

Create and copy

Click Create. Copy the API Key immediately and store it somewhere safe.
API Keys are usually shown in full only once. If you forget to save a key, delete it and create a new one.

Naming examples

ScenarioExample name
Codex CLIcodex-macbook
Claude Codeclaude-code-work
Cursorcursor-desktop
Cherry Studiocherry-studio-home

Store and use the key

Store the key in a password manager, system keychain, or local-only environment variable. Do not put it in public repositories, screenshots, chat logs, or shared documents. For Claude Code, check whether the API key list has a Use key action. The dashboard may show environment variables or config snippets for that key. For tools that support import, check whether the dashboard provides a one-click import action. Names and available actions depend on the current dashboard.

Test whether the key works

After creating a key, prefer the target client’s built-in test action. You can also test the OpenAI compatible models endpoint.

macOS or Linux

curl "https://api.4096bytes.com/v1/models" \
  -H "Authorization: Bearer YOUR_4096BYTES_API_KEY"

Windows PowerShell

Invoke-RestMethod `
  -Uri "https://api.4096bytes.com/v1/models" `
  -Headers @{ Authorization = "Bearer YOUR_4096BYTES_API_KEY" }
Replace YOUR_4096BYTES_API_KEY with the API Key you just created. If the response contains a model list, the API Key and Base URL are basically working. If the test fails, check these items first.
ItemWhat to check
Complete keyDo not miss characters or copy extra spaces/newlines.
Available groupThe key group must be enabled and contain the model you call.
Balance or quotaAccount balance, subscription quota, and key quota can all affect requests.
Correct Base URLCopy the Base URL shown in the dashboard. Do not guess the path.

Maintenance

Regularly remove unused keys. Disable or delete keys that are old, unclear, unused, or suspected to be leaked. After deleting a key, any client using it will fail immediately. Create a new key and update the client configuration.

Next step

Choose a client: CC Switch, Codex, Claude Code, Cursor, or Cherry Studio.