DEV Community

shashank ms
shashank ms

Posted on

Token-Based LLM API with Request-Based Pricing and Chain-of-Thought Reasoning

Chain-of-thought reasoning has become the default mechanism for extracting reliable, verifiable results from large language models. Models such as DeepSeek R1, Kimi K2 Thinking, and Qwen 3 generate explicit intermediate reasoning traces before delivering a final answer. While this dramatically improves accuracy on coding, mathematics, and agentic tasks, it also multiplies token volume. Under token-based billing, every reasoning token, tool call, and context window expansion adds to the bill. For teams running agentic loops or long-context pipelines, this unpredictability makes budgeting a headache.

Why Chain-of-Thought Blows Up Token Budgets

Reasoning models do not just return answers. They explore hypotheses, backtrack, and invoke tools, often producing intermediate text that is many times longer than the final output. In a token-based economy, you pay for all of it.

Agentic workflows compound the problem. A single task might involve:

  • A system prompt with extensive tooling schema.
  • Multi-turn conversation history.
  • Long document contexts, sometimes exceeding 100K tokens.
  • Reasoning traces and function-call metadata on every step.

Providers that bill by the token, including Together AI, Fireworks AI, OpenRouter, Replicate, and Anyscale, scale cost linearly with this volume. The result is that heavier reasoning and richer context directly translate to higher bills, often in ways that are hard to forecast before a request executes.

Flat Pricing for Reasoning Workloads

Oxlo.ai departs from token-based billing with a simple contract: one flat cost per API request, regardless of prompt length or output depth. This means a short greeting and a 1M-token agentic trace with extensive chain-of-thought are billed the same way, as single requests.

For long-context and agentic workloads, this structure removes the tax on reasoning. You do not need to trim system prompts, compress conversation history, or disable tool definitions to save tokens. Instead, you design the best possible prompt and let the model think.

Oxlo.ai is fully OpenAI SDK compatible, so switching usually requires only a base URL change. The API endpoint is https://api.oxlo.ai/v1, and there are no cold starts on popular models.

Reasoning Models on Oxlo.ai

The platform hosts more than 45 models across seven categories, including several built for advanced chain-of-thought reasoning:

  • DeepSeek R1 671B MoE: Deep reasoning and complex coding.
  • Kimi K2 Thinking: Advanced chain-of-thought reasoning.
  • Kimi K2.5 and K2.6: Advanced reasoning, agentic coding, and vision, with up to 131K context.
  • Qwen 3 32B: Multilingual reasoning and agent workflows.
  • DeepSeek V4 Flash: Efficient MoE architecture, 1M context window, near state-of-the-art open-source reasoning.
  • GLM 5: 744B MoE for long-horizon agentic tasks.
  • DeepSeek V3.2: Coding and reasoning, available on the free tier.

These models support streaming, function calling, JSON mode, multi-turn conversations, and vision where applicable. You can use them through standard endpoints such as chat/completions. Beyond reasoning, Oxlo.ai hosts models for code, vision, image generation, audio, embeddings, and object detection, all under the same request-based pricing.

Code Example: Running a Reasoning Model

Because Oxlo.ai uses the OpenAI SDK, you can run a chain-of-thought model with a few lines of Python. The following example sends a complex coding problem to DeepSeek R1 and streams the reasoning trace.

import openai

client = openai.OpenAI(
    base_url="https://api.oxlo.ai/v1",
    api_key="YOUR_OXLO_API_KEY"
)

response = client.chat.completions.create(
    model="deepseek-r1-671b",
    messages=[
        {"role": "system", "content": "You are a helpful coding assistant. Think step by step."},
        {"role": "user", "content": "Write a Python function that finds all palindromic substrings in O(n^2) time."}
    ],
    stream=True
)

for chunk in response:
    content = chunk.choices[0].delta.content
    if content:
        print(content, end="")

Notice that the cost of this request is flat. Whether the model responds in 500 tokens or 5,000 tokens of reasoning, the bill is the same. You can view exact plan details on the Oxlo.ai pricing page.

When Flat Pricing Wins

Request-based pricing is not just a billing convenience. It changes architectural decisions. Teams no longer have to choose between thorough reasoning and cost control.

Scenarios where Oxlo.ai is significantly cheaper than token-based alternatives include:

  • Long-context ingestion. Feeding lengthy documentation, codebases, or conversation histories into models like DeepSeek V4 Flash with its 1M context window counts as one request.
  • Agentic tool loops. Each iteration that appends tool results and reasoning traces to the conversation history adds tokens on metered platforms. On Oxlo.ai, each round trip is one request.
  • Batch reasoning. Running chain-of-thought over thousands of examples benefits from predictable per-request economics.

The difference can be 10-100x for long-context workloads, because token-based providers charge for every input and output token while Oxlo.ai charges for the request itself.

Getting Started

Oxlo.ai offers a free tier with 60 requests per day across 16+ models, including a 7-day full-access trial. Paid plans scale from Pro at 1,000 requests per day to Premium at 5,000 requests per day, both with access to all models and priority queueing on Premium. Enterprise plans provide custom volume, dedicated GPUs, and a guaranteed 30% savings versus your current provider.

To start, point your OpenAI client to https://api.oxlo.ai/v1, pick a reasoning model, and stop counting tokens.

Top comments (0)