Practical integration

Claude Code with CLODEX API

Connect Claude Code using the settings in /docs: the gateway base, CLODEx key and exact model ID. Start with a temporary shell configuration without overwriting existing settings.

Get a key for Claude Code

Create a separate CLODEX key for the agent, set a test quota and inspect /v1/models. Store the secret as CLODEX_API_KEY and an available Messages-capable ID (such as claude-opus-5-5 or claude-sonnet-5-5 on original CLAUDE_AWS and CLAUDE_MAX channels) as CLODEX_MODEL. Do not use the main credential of another application for this first test.

claude-fable-5 and claude-fable-5.1 are separate routes. Use an exact available ID: a familiar CLI alias may resolve to a different name. A catalog entry does not validate every Claude Code capability; test the required tools independently.

Create and check a key · Test Messages independently of the CLI

Launch from Bash or zsh

Install Claude Code using its official instructions and check claude --version. Run this block in a terminal where CLODEX_API_KEY and CLODEX_MODEL are already set. Parentheses create a subshell, so the parent terminal’s settings remain unchanged when Claude Code exits.

This example chooses x-api-key authentication through ANTHROPIC_API_KEY. It removes ANTHROPIC_AUTH_TOKEN only inside the subshell to avoid leaving a second credential source. Do not paste a secret directly into a command where shell history could retain it.

The MCP setup in /docs also uses ENABLE_TOOL_SEARCH=false and MAX_MCP_OUTPUT_TOKENS=50000. These belong to that tool configuration, not to basic text authentication. Do not reinstall Figma MCP if you do not need it.

# Bash / zsh: CLODEX_API_KEY and CLODEX_MODEL must already be set.
(
  : "${CLODEX_API_KEY:?Set CLODEX_API_KEY in your protected environment}"
  : "${CLODEX_MODEL:?Choose an exact Messages model ID}"
  unset ANTHROPIC_AUTH_TOKEN
  export ANTHROPIC_BASE_URL="https://clodex.xyz"
  export ANTHROPIC_API_KEY="$CLODEX_API_KEY"
  claude --model "$CLODEX_MODEL"
)

Official gateway setup · Claude Code model configuration

Check the active configuration before work

  • Open /status in Claude Code. Check https://clodex.xyz and the credential source. Do not start a task if it shows a different destination or subscription login.
  • Confirm the selected model. --model passes an ID; it does not add protocol or tool support to that model.
  • Project settings, managed settings and apiKeyHelper can affect configuration. Resolve a mismatch shown by /status rather than disabling organizational policies.
  • Start in an empty test directory with one short text prompt. This is a paid request. Inspect usage before proceeding to file access.

Test file access with a disposable fixture

Create README.md in the test directory containing one line: “demo”. Ask: “Read only README.md and tell me how many lines it has. Do not modify files or run commands.” Check requested permissions and the actual result, not just the agent’s claim that it finished.

You can then test a separate edit to a disposable file and inspect the diff. Do not bypass tool approvals to make the test pass. An API credential is not permission to read secrets, delete data or change production.

For a real project, define which files may be read, what must not change and which tests to run. A long agent session involves several requests and repeated context, not just the final visible answer.

Model pricing · Session usage reference (Russian)

Distinguish gateway errors from client configuration

SymptomNext check
401 / 403Inspect /status, key expiration and model access. Never print secret environment values.
Model not foundCompare --model with the exact ID in your key’s catalog. Do not silently substitute another model.
Text works but tools failCheck tool support, CLI version and the sanitized error. The text probe did not validate this mode.
404 or an HTML pageCheck the base URL without an extra /v1 and inspect local proxy settings.
Interrupted stream / timeoutCheck request completion and usage before retrying. Do not launch identical sessions concurrently.

Share sanitized diagnostics (Russian)

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.

Client configuration · API protocols

Frequently asked questions

Does this change my global shell profile?

No. The shown block scopes changes to a subshell. Claude Code configuration files may apply their own values; check the effective configuration through /status.

Are a Claude subscription and CLODEX balance interchangeable?

No. This setup sends requests to CLODEX with a CLODEX credential. It does not connect a paid subscription on the model owner’s website.

Why is a successful text answer not enough?

The agent may require streaming, tools and additional requests. Validate each required capability on a safe fixture before working in a repository.

Connect CLODEX API to your application

One key-management layer, compatible endpoints and several LLM families for apps, agents and developer tools.