Choosing an API based only on its advertised price is an easy way to underestimate production costs.
A language model may advertise a low price per million tokens, but a long system prompt, conversation history, tool definitions, retries, and verbose output can increase the real cost of every task. A pay-per-call API looks simpler, but polling, status checks, secondary requests, and external execution fees can produce the same surprise.
The useful question is therefore not, “Which pricing model is cheaper?”
It is:
Which pricing unit matches the work my application actually performs?
Token-based pricing usually works well for variable-length AI generation. Pay-per-call pricing is often more predictable for search, structured data, blockchain queries, image generation, and other tasks with a defined result.
JarvisClaw combines both models through an OpenAI-compatible model gateway and a broader API Marketplace, allowing developers to use one infrastructure layer while choosing the most appropriate pricing model for each step.
How Token-Based API Pricing Works
Token pricing charges separately for the content sent to a model and the content generated by it.
The basic calculation is:
Request cost =
(input tokens ÷ 1,000,000 × input rate)
+
(output tokens ÷ 1,000,000 × output rate)
JarvisClaw’s published model rates include different prices for input and output. Current documentation examples list DeepSeek Chat at $0.20 per million input tokens and $0.40 per million output tokens, while Claude Sonnet 4.6 is listed at $3 per million input tokens and $15 per million output tokens. Rates differ substantially by model, so developers should verify the live pricing before deployment.
Consider a request containing 10,000 input tokens and producing 1,000 output tokens.
For DeepSeek Chat:
Input: 10,000 ÷ 1,000,000 × $0.20 = $0.0020
Output: 1,000 ÷ 1,000,000 × $0.40 = $0.0004
Total: $0.0024
Using the same token volume with Claude Sonnet 4.6:
Input: 10,000 ÷ 1,000,000 × $3.00 = $0.030
Output: 1,000 ÷ 1,000,000 × $15.00 = $0.015
Total: $0.045
The task is identical, but the second request costs almost 19 times more. That does not automatically make the more expensive model a poor choice. If it produces a reliable result in one attempt while the cheaper model needs multiple retries, its cost per successful outcome may be lower.
This is the first hidden pricing lesson: compare completed tasks, not isolated requests.
How Pay-Per-Call Pricing Works
A pay-per-call API charges a fixed or quoted amount each time an endpoint is invoked.

The simple calculation is:
Total cost =
number of API calls × price per call
This model is easier to estimate when each request produces a defined result.
For example, JarvisClaw’s Marketplace documentation currently lists web search operations from $0.004 to $0.012 per call, DEX endpoints around $0.001 per call, blockchain RPC at $0.002 per call, and music generation at $0.1575 per track. Image and video pricing uses output-oriented units such as price per image or per generated second.
A research workflow making 100 semantic search requests at $0.012 each would have an estimated search cost of:
100 × $0.012 = $1.20
Unlike a token-priced request, the charge does not grow simply because the search query contains several more words. However, asking for content extraction, highlights, or an AI-generated answer may invoke additional endpoints.
JarvisClaw advises developers to read the exact amount returned in price.amount, rather than assuming every operation in a category has the same price.
Pay-Per-Call vs Token Pricing at a Glance
| Factor | Pay-Per-Call | Token-Based |
|---|---|---|
| Billing unit | Endpoint request or generated asset | Input and output tokens |
| Best suited for | Search, market data, RPC, tools and media | Chat, analysis, extraction and generation |
| Cost predictability | High when the number of calls is known | Depends on prompt and response length |
| Main hidden cost | Polling, retries and secondary calls | Context growth, verbose output and retries |
| Optimization method | Reduce unnecessary requests | Reduce tokens and select the right model |
| Budget control | Maximum calls or price per request | Token limits and model-specific budgets |
Neither model is universally better. Most real AI products need both.
A Practical Hybrid Cost Example
Suppose an AI agent must research a company and prepare a short risk summary.
The workflow uses:
- Three semantic web searches at $0.012 each
- Two content extraction calls at $0.004 each
- One DeepSeek request with 20,000 input tokens
- A 2,000-token final answer
The pay-per-call portion is:
Search: 3 × $0.012 = $0.036
Extraction: 2 × $0.004 = $0.008
Tool subtotal: $0.044
The model portion is:
Input: 20,000 ÷ 1,000,000 × $0.20 = $0.0040
Output: 2,000 ÷ 1,000,000 × $0.40 = $0.0008
Model subtotal: $0.0048
Estimated total:
$0.044 + $0.0048 = $0.0488
In this example, tool use represents roughly 90% of the expense. Optimizing the prompt by 20% would save less than removing one unnecessary search.
That is a frequently overlooked insight: in tool-using agents, model tokens may not be the largest cost.
The Hidden Costs Developers Often Miss
Conversation History
A chat application may resend its full history on every turn. A conversation that begins with 2,000 input tokens can grow to 20,000 tokens after several exchanges.
Summarize old messages, store structured state outside the prompt, and send only context relevant to the next decision.
Tool Definitions
Large MCP or function-calling schemas consume input tokens. Giving an agent 100 tool definitions when it needs five adds cost and can reduce tool-selection accuracy.
Expose tools by task, role, or workflow stage.
Retries
A failed request may still involve paid processing. Uncontrolled retry logic can turn a temporary error into several duplicate charges.
Use exponential backoff, idempotency where supported, and a strict retry limit.
Polling
A job may require one request to start and repeated requests to check its status. If every status request is billable, aggressive polling can cost more than expected.
Use longer polling intervals, webhooks when available, and a maximum number of status checks.
External Execution Costs
A pay-per-call fee may cover access to an endpoint without covering the underlying action.
JarvisClaw’s DEX documentation, for example, separates the API call charge from on-chain Gas. Gasless execution can remove Gas for supported swaps, but it does not remove the API call fee.
Output Length
Output tokens are often more expensive than input tokens. Asking for “a comprehensive report” when a structured 200-word answer is sufficient wastes money and slows the application.
Set explicit output limits and request JSON when downstream software needs data rather than prose.
When to Choose Each Pricing Model
Choose token-based pricing when:
- The value depends on generated or analyzed language.
- Prompt and output lengths vary significantly.
- Different models are needed for different complexity levels.
- You can control context size and maximum output.
- A smaller model can handle routine requests.
Choose pay-per-call pricing when:
- Each request produces a specific result.
- Request size has little relationship to provider cost.
- You need straightforward per-action budgeting.
- The endpoint returns structured data.
- Your agent needs occasional access to many specialized tools.
Use a hybrid design when an agent retrieves data, calls tools, and then asks a model to interpret the results. This is the most common architecture for research agents, trading assistants, monitoring systems, and automated content workflows.
How to Control Production API Spending
Do not depend on a monthly invoice to reveal inefficient behavior.
Record the following for every task:
task_id
endpoint_or_model
input_tokens
output_tokens
tool_call_count
retry_count
quoted_price
actual_price
task_status
Then measure:
Cost per successful task =
total workflow spend ÷ successful completed tasks
This metric is more useful than cost per request because it includes retries and multi-step workflows.
With JarvisClaw, developers can configure wallet controls such as daily, monthly, and per-request maximums. The documented per-request field is per_request_max_usd; using a different field name may leave the intended limit unchanged.
A practical production policy might include:
- A low-cost model for classification and routing
- A stronger model only for complex requests
- A maximum output-token limit
- A per-request spending cap
- A maximum number of tool calls per task
- Human approval above a defined threshold
- Alerts when cost per successful task rises
JarvisClaw also supports x402-based payment flows. A client can receive a machine-readable HTTP 402 quote, authorize the payment, and retry the request; supported SDKs can automate that exchange.
The Better Pricing Strategy
Pay-per-call pricing gives developers a clear price for a defined action. Token pricing gives them flexibility for language tasks whose workloads vary.
The strongest architecture does not force every operation into one pricing model. It routes each task to the right service, estimates the full workflow cost, and enforces spending limits before execution.
Use token pricing for reasoning and generation. Use pay-per-call endpoints for bounded external operations. Most importantly, optimize for the cost of a successful business result—not the cheapest-looking line on a pricing page.
Explore the JarvisClaw API Marketplace and review the developer documentation before finalizing production estimates.
FAQ
What is pay-per-call API pricing?
Pay-per-call pricing charges a defined amount whenever an endpoint is invoked. It is commonly used for search, market data, blockchain queries, media generation, and specialized tools.
What is token-based API pricing?
Token-based pricing charges for the text or data sent to and generated by an AI model. Input and output tokens usually have different rates.
Is pay-per-call pricing cheaper than token pricing?
Not automatically. The answer depends on the number of calls, token volume, retries, secondary operations, and quality required. Compare the total cost of completing the workflow.
How do I calculate an LLM request’s cost?
Multiply input tokens by the input rate and output tokens by the output rate, with both rates converted to the same token unit—usually one million tokens.
Are failed requests and retries free?
Do not assume they are. Billing behavior varies by endpoint and failure stage. Log every attempt, limit retries, and inspect the returned pricing or usage metadata.
What are the biggest hidden API costs?
Common hidden costs include repeated context, large tool schemas, verbose model output, polling, retries, unnecessary discovery calls, and external expenses such as blockchain Gas.
Can I combine pay-per-call tools with token-priced models?
Yes. A typical agent can use pay-per-call APIs to retrieve structured information and then send the results to a token-priced model for analysis or summarization.
How can AI agents avoid overspending?
Apply daily, monthly, and per-request limits; restrict tool access; cap output length and retries; estimate costs before execution; and require approval for requests above a defined threshold.
