Skip to content

What is the difference between max_tokens and max_credits?

max_tokens limits requested output length, from 1 to 4096 on the current DeepSeek route. max_credits is the maximum credit reservation you approve for the entire request. They are different controls. Reducing output length can reduce the quote, but a large max_credits value does not expand the model's supported output-token limit.

BUILD NON-STREAMING TEXT WORKFLOWSAISwapLab team · Editorial methodPublished 2 min read
Open API documentationExplore 67 Image SkillsPrivate keys · Explicit credit approval
Article workflow: Choose a useful answer length; Quote the complete conversation; Compare the final receipt.
Workflow diagram: Choose a useful answer length → Quote the complete conversation → Compare the final receipt. Read the article for evidence and limits.

The estimate includes input as well as output

A long message history can require a substantial reservation even when you want a short answer. The quote uses a conservative input bound and the requested output ceiling, then confirmed completion settles against measured token usage. The default output ceiling is 256 tokens when max_tokens is omitted.

What to do next

  1. 01

    Choose a useful answer length

    Set max_tokens for the actual task, such as a short label or a longer explanation. Avoid requesting the maximum for every trivial operation merely because it is available.

  2. 02

    Quote the complete conversation

    Send the actual messages and output ceiling to /quotes. Review the resulting credits and usage ceiling before choosing an approved max_credits value.

  3. 03

    Compare the final receipt

    After confirmed completion, retain measured tokens, reserved_credits and final credits. Explain unused reservation returns separately from a failed-job refund.

A concrete example

Illustrative choice: a short caption task requests max_tokens 128 but includes a long brief. Its total estimate includes that input. Raising max_tokens to 4096 would increase the reservation without making the caption inherently better.

The two ceilings and the measured receipt

ValueMeaning
max_tokensRequested output-token ceiling, 1–4096
max_creditsApproved per-request credit reservation ceiling
usage.prompt_tokensConfirmed measured input tokens
usage.completion_tokensConfirmed measured output tokens
reserved_creditsInitial accepted credit reservation
creditsFinal settled charge when confirmed

Before you call it ready

  • Length and spending controls are labeled separately.
  • Input history is included in estimation.
  • Final usage is not assumed to equal the ceiling.

When to stop or choose another method

If the quote exceeds approval, shorten the task or obtain a deliberate revised approval. Do not automatically raise max_credits simply to make the request pass.

Sources

One task. A recoverable workflow.

Check the contract, approve the quote and retain the job.

Open API documentation