1. Create a key for one application
Sign in to CLODEX and open API keys. Use a name such as support-bot-test rather than “key 1”. Give a test bot and a production service different keys: you can identify their usage and revoke one integration without taking down the other.
Set an expiration, quota and model restrictions as needed. Store the secret in your server’s protected environment as CLODEX_API_KEY. Do not put it in Git, frontend variables such as VITE_ or NEXT_PUBLIC_, bot messages or screenshots.
2. Read the catalog without generating content
Run this command on a machine where CLODEX_API_KEY is already set. It requires curl. GET /v1/models reads the catalog; it does not test response quality or prove that a listed model can successfully complete a request right now.
In a successful response, find the exact ID in data[].id and store your chosen value as CLODEX_MODEL. Do not automatically use the first entry: list order is not a recommendation. One key may access several models, but check access restrictions and protocols for each.
curl --fail-with-body --silent --show-error \
--connect-timeout 10 --max-time 30 \
https://clodex.xyz/v1/models \
-H "Authorization: Bearer $CLODEX_API_KEY"
3. Diagnose a failed check
For support, record the time with its timezone, HTTP status and a safe request identifier if available. Remove credentials, Authorization headers and personal data from any attached request.
| Symptom | What to check | What will not help |
|---|---|---|
| 401 or authentication error | clodex.xyz address, Bearer header, key status and expiration. Do not log the secret. | Repeating the same request with unchanged credentials. |
| 403 or an access restriction | Error body, allowed models and restrictions on this key. | Guessing model IDs from the public website. |
| 429 | Server message, request rate, quota and balance. The status alone does not identify the cause. | An unbounded retry loop. |
| HTML instead of JSON, or 404 | Full https://clodex.xyz/v1/models URL and proxy settings. | Changing the model: this request does not generate content. |
4. Separate credentials from usage charges
An API key is a credential, not a subscription to every model. When comparing offers to “buy an API key”, check what model usage costs: input, output, cached input or the published fixed billing unit. Several keys do not imply separate account balances.
After checking the catalog, send one short request using the model’s supported protocol and review actual usage in the dashboard. That generation consumes balance. A CLODEX credential is for the CLODEX endpoint, not for direct calls to OpenAI or Anthropic.
Rates and billing units · First request with the OpenAI SDK · Usage reference (Russian)
5. Replace an exposed key
- Revoke the compromised key immediately. Removing a message or the latest commit does not make the credential safe again.
- Create a replacement and update your application’s protected environment. Restart your own application if it reads credentials only at startup.
- Check the catalog using the new key and verify that the application uses it. Do not leave the old key as a fallback.
- Review request history and spending during the exposure period. Report unexplained activity without sending the secret itself.
Documentation and example scope
Connection settings follow CLODEx documentation. Examples target the stated protocol; they are not recorded inference results and do not promise identical features across models. A successful generation request can incur a charge.
Frequently asked questions
Can I put the key in a browser widget?
No. The widget should call your backend, which calls CLODEX. Otherwise a visitor can extract the secret from source code or network requests.
Why is a public model unavailable to my key?
The public catalog and your key’s available models are different views. Check the exact ID, key restrictions and supported route.
Does GET /v1/models generate content?
No. A POST generation request is a separate action charged according to the selected model’s rate.