Practical integration

LLM API: choose a protocol

CLODEx exposes three text protocols: Chat Completions, Responses and Messages. Match your client first, then compare models on the same task using actual charges.

Which endpoint does your application need?

Check the method your client calls. client.chat.completions.create, client.responses.create and Anthropic Messages send different request bodies and return different structures. Changing a URL does not convert one protocol into another.

The table describes CLODEX routes. It does not promise that every model supports all three. Check tools, images, streaming and other optional features separately for the exact model ID you intend to use.

Client / protocolEndpoint and inputResponse to handle
Chat CompletionsPOST /v1/chat/completions · messageschoices[].message; finish_reason; usage
ResponsesPOST /v1/responses · inputoutput items; status; usage. Not choices.
Anthropic-compatible MessagesPOST /v1/messages · messages + max_tokenscontent blocks; stop_reason; usage

Connect the OpenAI SDK · Send a Messages request

Check a model before migrating an application

A successful text request confirms only that request. It does not validate an agent with files, long context or concurrent tool calls. Test the capabilities your application actually needs separately.

  • Read /v1/models using your application’s key and choose an exact data[].id. A public model page does not replace this check.
  • Match that ID to a documented protocol. Do not copy parameters from another model merely because their names look similar.
  • Send one short request without tools, attachments or streaming. It is a paid generation; set a test quota beforehand.
  • Inspect the response format and completion reason. Add optional features one at a time so you can identify what breaks.

Check the catalog without generation · Models and routes

Compare the cost of an accepted result

Prepare a small set of your own tasks and decide in advance what counts as an accepted answer: passing tests, valid JSON or correct field extraction. Identical inputs and acceptance criteria are more useful than comparing one price per million tokens.

For split token pricing, calculate uncached input, cached input and output at their respective rates. If a tariff uses Fixed Usage for total tokens, follow that published rule instead of automatically applying this formula. Never count the same cached input twice.

  • Record the model ID, task size, attempts, actual spending and why an answer was rejected.
  • Include unsuccessful paid attempts in total_actual_spend. If no answers pass, cost per accepted result is undefined.
  • Keep the measurement date with latency and tariff records. One successful run is not a speed guarantee.
cost = uncached_input / 1_000_000 * input_rate
     + cached_input   / 1_000_000 * cache_rate
     + output         / 1_000_000 * output_rate

cost_per_accepted_result = total_actual_spend / accepted_results

Current rates and billing units · Usage reference (Russian)

Check connectivity from the deployment environment

Test from the server that will run the application, not just your home browser. DNS, TLS, corporate proxies and outbound network rules can differ. A browser opening the website does not establish that the server can reach an authenticated API route.

A CLODEX key works with the CLODEX endpoint. It does not create an account with a model owner or purchase a subscription to their website. Check available payment options in your dashboard. This page does not promise access from every network or identical conditions for every account.

Troubleshoot connectivity (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

Which protocol should a new bot use?

Use one supported by both your client and chosen model. Validate one non-streaming text request first rather than implementing several protocols at once.

Can I switch models by changing the ID?

Only when the required protocol and capabilities match. Check parameters, response handling, limits and billing before switching production traffic.

Why can a lower token rate cost more overall?

Retries, long outputs and rejected answers also consume balance. Compare actual spending on accepted results for the same task.

Connect CLODEX API to your application

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