UniRoute
Docs

CLI and API differences

Understand CLI and API interfaces, protocol compatibility, pricing, and shared account billing.

UniRoute provides interfaces for CLI tools and standard API clients. This guide explains their differences and why the interface must match the client you use.

The main difference

CLI and API interfaces can use different channels

Even when accessing the same model, such as Gemini, a CLI tool and a general API client can use different interfaces:

  • A CLI tool, such as Gemini CLI, uses the interface expected by that CLI to reach the model.
  • An API client, such as Cherry Studio, uses a standard API interface to reach the model.

Their request formats, response formats, and parameter structures can differ.

Why should you not mix them?

Using an API interface in a CLI that expects a different interface, or using a CLI-specific interface in a general API client, can cause:

  • Different behavior from the same model.
  • Features that do not work correctly.
  • Unusual problems that are difficult to diagnose.

Use the protocol and base URL specified in the tutorial for your client.

Correct usage

CLI interfaces: coding tools

Use a CLI-specific interface only with its corresponding command-line tool. The tool sends the request format expected by that interface.

API interfaces: general clients

Use standard API interfaces for general API clients and your own application integrations.

Price differences

CLI and API channels may have different prices:

  • Channel costs: providers can price CLI resources and API resources differently.
  • Quota controls: QPM, or requests per minute, and TPM, or tokens per minute, can differ.

Check the current pricing page for actual rates. Prices can change with provider adjustments.

Why prices change

  1. Provider pricing: UniRoute updates rates when providers such as Google, Anthropic, or OpenAI adjust their pricing.
  2. Channel costs: some discounted channels depend on subscription-based resources or other channel mechanisms. Stronger upstream controls can increase costs and require a price adjustment.

Price changes reflect changes in upstream costs. The platform aims to keep pricing stable, but rising channel costs can require new rates.

Frequently asked questions

Why does Gemini CLI behave differently when I use an API address?

A standard API interface may not include the coding-oriented system prompts expected by the CLI interface, which can change results for coding tasks. Use the address and protocol documented for Gemini CLI.

Can I use a CLI interface for API development?

It is not recommended. CLI-specific request and response formats are designed for the command-line tool and can cause compatibility issues in a custom integration.

Why not make every interface the same?

See Why UniRoute keeps native API formats. Converting formats can lose features or change model behavior, making it harder to preserve the provider's native experience.

Is my usage combined?

CLI and API usage is recorded separately and each consumes the applicable allowance. They share the account balance, and calls using the same unified key share that key's spending limits.

Summary

  • CLI interfaces: use them with the corresponding CLI, such as Claude Code, Gemini CLI, or Codex.
  • API interfaces: use them with Cherry Studio or custom API integrations.
  • Match the client and interface: mixing incompatible interfaces can change behavior or break features.

Choosing the correct interface helps you get the intended experience.

Related guides