Access & authentication
Creating an API key, keeping it safe, auth headers, per-SDK base URLs, balance, and per-key spend limits.
1. API keys
1.1 How do I create an API key?
Enter a name on the console's API Keys page and create the key. The name is required, and you get a key starting with sk-.
At creation you choose which models the key may use. LLMs available on both channels can be set to Standard or Flex individually, defaulting to Flex; media models only use Standard. The full walkthrough is in Quick start.
1.2 The key is shown only once — can I recover it?
No. Delete it and create a new one. The full key appears only when it is created; afterwards the list shows a mask like sk-a1b2c…8f9d.
Copy it into a password manager or a secure environment variable while it's on screen.
1.3 What do I do if a key leaks?
Disable or delete that key on the API Keys page immediately, then create a new one.
An sk- key spends account balance directly. Never put it in frontend code, commit it to Git, or paste it anywhere public.
1.4 Can I restrict a key to certain models?
Yes — select the authorized models when you create the key. From then on, that key's GET /v1/models returns only models it is authorized for and that remain available under the account's permissions and actual upstream routing.
2. Authentication & base URLs
2.1 Which authentication header do I send?
Use Authorization: Bearer sk-YOUR_KEY. The gateway also accepts x-api-key: sk-YOUR_KEY. See Protocols & endpoints.
2.2 Which base URL do I use, and does it need /v1?
It depends on the SDK:
| Use | Base URL |
|---|---|
| OpenAI SDK | https://hopsapi.com/v1 |
| Anthropic SDK, Google Gen AI SDK | https://hopsapi.com |
| cURL against a full path | https://hopsapi.com/v1/... |
The Anthropic and Google SDKs append the rest of the path themselves, so give them the bare domain. None of the three take a trailing slash. Follow the complete example on each protocol page.
3. Balance & spend limits
3.1 Can I call anything before topping up?
You can create keys and call GET /v1/models, but paid inference requests return HTTP 402.
Check your balance on the console's Overview page and add credits on the Top-up page.
3.2 Can I cap spending on a single key?
Yes. The API Keys page offers four limit types: unlimited, fixed-total, UTC weekly, and UTC monthly.
Weekly and monthly limits reset automatically. Changing the amount within the same type preserves current-period usage; changing the type starts a new period. Once the cap is reached, that key returns HTTP 402 with insufficient_quota. See Billing & reconciliation.